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

Unified Diff: utils/tests/pub/test_pub.dart

Issue 12087008: Handle parsing the "version" file better. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« no previous file with comments | « utils/tests/pub/real_version_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/test_pub.dart
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index 2ef2689fb4bfb6216c63f10aa9c9f06e995c81b3..a7c93bd32b724b0e95fa487ba64e6a54875b512d 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -808,7 +808,9 @@ abstract class Descriptor {
if (name is String) {
var path = join(dir, name);
return exists(path).then((exists) {
- if (!exists) Expect.fail('File $name in $dir not found.');
+ if (!exists) {
+ throw new ExpectException('File $name in $dir not found.');
+ }
return validate(path);
});
}
@@ -824,7 +826,7 @@ abstract class Descriptor {
return listDir(dir).then((files) {
var matches = files.where((file) => endsWithPattern(file, name)).toList();
if (matches.isEmpty) {
- Expect.fail('No files in $dir match pattern $name.');
+ throw new ExpectException('No files in $dir match pattern $name.');
}
if (matches.length == 1) return validate(matches[0]);
@@ -888,8 +890,9 @@ class FileDescriptor extends Descriptor {
return readTextFile(file).then((text) {
if (text == contents) return null;
- Expect.fail('File $file should contain:\n\n$contents\n\n'
- 'but contained:\n\n$text');
+ throw new ExpectException(
+ 'File $file should contain:\n\n$contents\n\n'
+ 'but contained:\n\n$text');
});
});
}
@@ -1133,7 +1136,9 @@ class NothingDescriptor extends Descriptor {
Future validate(String dir) {
return exists(join(dir, name)).then((exists) {
- if (exists) Expect.fail('File $name in $dir should not exist.');
+ if (exists) {
+ throw new ExpectException('File $name in $dir should not exist.');
+ }
});
}
« no previous file with comments | « utils/tests/pub/real_version_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698