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

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

Issue 24276010: Change package scheduled_test to throw TestFailures rather than strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove checks and comments on type of exception thrown. Created 7 years, 3 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 a8051cc58dabadc8ae62557a16068e399c55a9cf..2607ed0a8dff9ccdbab4dab0c35fe3beee2004a8 100644
--- a/pkg/scheduled_test/test/descriptor/directory_test.dart
+++ b/pkg/scheduled_test/test/descriptor/directory_test.dart
@@ -300,9 +300,9 @@ void main() {
d.file('name.txt', 'contents')
]);
- expect(dir.load('subdir').toList(),
- throwsA(equals("Couldn't find a readable entry named 'subdir' within "
- "'dir'.")));
+ expect(dir.load('subdir').toList(), throwsA(predicate(
+ (x) => x.toString() == "Couldn't find a readable entry named "
+ "'subdir' within 'dir'.")));
});
});
@@ -331,9 +331,9 @@ void main() {
test('test', () {
var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
- expect(dir.load('not-name.txt').toList(),
- throwsA(equals("Couldn't find a readable entry named 'not-name.txt' "
- "within 'dir'.")));
+ expect(dir.load('not-name.txt').toList(), throwsA(predicate(
+ (x) => x.toString() == "Couldn't find a readable entry named "
+ "'not-name.txt' within 'dir'.")));
});
});
@@ -345,9 +345,9 @@ void main() {
d.file('name.txt', 'contents')
]);
- expect(dir.load('name.txt').toList(),
- throwsA(equals("Found multiple readable entries named 'name.txt' "
- "within 'dir'.")));
+ expect(dir.load('name.txt').toList(), throwsA(predicate(
+ (x) => x.toString() == "Found multiple readable entries named "
+ "'name.txt' within 'dir'.")));
});
});
@@ -412,4 +412,4 @@ void main() {
expect(d.dir('dir').describe(), equals('dir'));
});
});
-}
+}

Powered by Google App Engine
This is Rietveld 408576698