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

Unified Diff: pkg/scheduled_test/lib/src/descriptor/pattern_descriptor.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: 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/lib/src/descriptor/pattern_descriptor.dart
diff --git a/pkg/scheduled_test/lib/src/descriptor/pattern_descriptor.dart b/pkg/scheduled_test/lib/src/descriptor/pattern_descriptor.dart
index 32af689fae2d5cb7cc62b9be0f003f5a51a42300..7039639221968f44e789c5e917fb31a1eeb3b65a 100644
--- a/pkg/scheduled_test/lib/src/descriptor/pattern_descriptor.dart
+++ b/pkg/scheduled_test/lib/src/descriptor/pattern_descriptor.dart
@@ -55,7 +55,7 @@ class PatternDescriptor extends Descriptor {
matchingEntries.sort();
if (matchingEntries.isEmpty) {
- throw "No entry found in '$parent' matching ${_patternDescription}.";
+ fail("No entry found in '$parent' matching ${_patternDescription}.");
}
return Future.wait(matchingEntries.map((entry) {
@@ -76,9 +76,9 @@ class PatternDescriptor extends Descriptor {
return prefixLines(result.last, firstPrefix: '* ', prefix: ' ');
}).join('\n');
- throw "Multiple valid entries found in '$parent' matching "
- "$_patternDescription:\n"
- "$resultString";
+ fail("Multiple valid entries found in '$parent' matching "
+ "$_patternDescription:\n"
+ "$resultString");
}
// If no entries matching [pattern] validated, that's also bad.
@@ -91,9 +91,9 @@ class PatternDescriptor extends Descriptor {
firstPrefix: '* ', prefix: ' ');
}).join('\n');
- throw "No valid entries found in '$parent' matching "
- "$_patternDescription:\n"
- "$resultString";
+ fail("No valid entries found in '$parent' matching "
+ "$_patternDescription:\n"
+ "$resultString");
});
}

Powered by Google App Engine
This is Rietveld 408576698