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

Unified Diff: pkg/scheduled_test/lib/src/descriptor/directory_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/directory_descriptor.dart
diff --git a/pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart b/pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart
index a1d63583a3193bf41c94e959d7fae5f40526f896..e5baf445d57b649364d18ad9908be78fcb9b9129 100644
--- a/pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart
+++ b/pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart
@@ -42,7 +42,7 @@ class DirectoryDescriptor extends Descriptor implements LoadableDescriptor {
if (parent == null) parent = defaultRoot;
var fullPath = path.join(parent, name);
if (!new Directory(fullPath).existsSync()) {
- throw "Directory not found: '$fullPath'.";
+ fail("Directory not found: '$fullPath'.");
}
return Future.wait(contents.map((entry) {
@@ -77,11 +77,11 @@ class DirectoryDescriptor extends Descriptor implements LoadableDescriptor {
var adjective = requiresReadable ? 'readable' : 'loadable';
if (matchingEntries.length == 0) {
- throw "Couldn't find a $adjective entry named '${split.first}' within "
- "'$name'.";
+ fail("Couldn't find a $adjective entry named '${split.first}' within "
+ "'$name'.");
} else if (matchingEntries.length > 1) {
- throw "Found multiple $adjective entries named '${split.first}' within "
- "'$name'.";
+ fail("Found multiple $adjective entries named '${split.first}' within "
+ "'$name'.");
} else {
var remainingPath = split.sublist(1);
if (remainingPath.isEmpty) {

Powered by Google App Engine
This is Rietveld 408576698