Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: pkg/scheduled_test/test/descriptor/directory_test.dart

Issue 16351003: Move pub over to using the pub.dartlang.org API v2. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/scheduled_test/test/descriptor/directory_test.dart
diff --git a/pkg/scheduled_test/test/descriptor/directory_test.dart b/pkg/scheduled_test/test/descriptor/directory_test.dart
index e54b1912d14bc35e38bea172fc8bcea1fda13aaf..16536b6df697cec31c6610d6cc4e0e6ddf751ae5 100644
--- a/pkg/scheduled_test/test/descriptor/directory_test.dart
+++ b/pkg/scheduled_test/test/descriptor/directory_test.dart
@@ -291,14 +291,6 @@ void main() {
});
});
- expectTestsPass("directory().read() fails", () {
- test('test', () {
- var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
- expect(dir.read().toList(),
- throwsA(equals("Can't read the contents of 'dir': is a directory.")));
- });
- });
-
expectTestsPass("directory().load() fails to load a nested directory", () {
test('test', () {
var dir = d.dir('dir', [
@@ -309,8 +301,8 @@ void main() {
]);
expect(dir.load('subdir').toList(),
- throwsA(equals("Can't read the contents of 'subdir': is a "
- "directory.")));
+ throwsA(equals("Couldn't find a readable entry named 'subdir' within "
+ "'dir'.")));
});
});
@@ -318,8 +310,7 @@ void main() {
test('test', () {
var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
- expect(dir.load('/name.txt').toList(),
- throwsA(equals("Can't load absolute path '/name.txt'.")));
+ expect(dir.load('/name.txt').toList(), throwsArgumentError);
});
});
@@ -327,14 +318,11 @@ void main() {
test('test', () {
var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
- expect(dir.load('.').toList(),
- throwsA(equals("Can't load '.' from within 'dir'.")));
+ expect(dir.load('.').toList(), throwsArgumentError);
- expect(dir.load('..').toList(),
- throwsA(equals("Can't load '..' from within 'dir'.")));
+ expect(dir.load('..').toList(), throwsArgumentError);
- expect(dir.load('').toList(),
- throwsA(equals("Can't load '' from within 'dir'.")));
+ expect(dir.load('').toList(), throwsArgumentError);
});
});
@@ -344,8 +332,8 @@ void main() {
var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
expect(dir.load('not-name.txt').toList(),
- throwsA(equals("Couldn't find an entry named 'not-name.txt' within "
- "'dir'.")));
+ throwsA(equals("Couldn't find a readable entry named 'not-name.txt' "
+ "within 'dir'.")));
});
});
@@ -358,8 +346,21 @@ void main() {
]);
expect(dir.load('name.txt').toList(),
- throwsA(equals("Found multiple entries named 'name.txt' within "
- "'dir'.")));
+ throwsA(equals("Found multiple readable entries named 'name.txt' "
+ "within 'dir'.")));
+ });
+ });
+
+ expectTestsPass("directory().load() loads a file next to a subdirectory with "
+ "the same name", () {
+ test('test', () {
+ var dir = d.dir('dir', [
+ d.file('name', 'contents'),
+ d.dir('name', [d.file('subfile', 'contents')])
+ ]);
+
+ expect(byteStreamToString(dir.load('name')),
+ completion(equals('contents')));
});
});
« no previous file with comments | « pkg/scheduled_test/test/descriptor/async_test.dart ('k') | pkg/scheduled_test/test/descriptor/file_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698