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

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

Issue 10850034: Rename BadNumberFormatException -> FormatException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 8 years, 4 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/test_pub.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/version_test.dart
diff --git a/utils/tests/pub/version_test.dart b/utils/tests/pub/version_test.dart
index 26f415ac99f5624a819dbf0135e93bedcf713740..29ef9744285364e03992f0e9a15b033eff7cd73e 100644
--- a/utils/tests/pub/version_test.dart
+++ b/utils/tests/pub/version_test.dart
@@ -121,13 +121,13 @@ main() {
expect(new Version.parse('1.0.0-rc-1+build-1'), equals(
new Version(1, 0, 0, pre: 'rc-1', build: 'build-1')));
- throwsBadFormat(() => new Version.parse('1.0'));
- throwsBadFormat(() => new Version.parse('1.2.3.4'));
- throwsBadFormat(() => new Version.parse('1234'));
- throwsBadFormat(() => new Version.parse('-2.3.4'));
- throwsBadFormat(() => new Version.parse('1.3-pre'));
- throwsBadFormat(() => new Version.parse('1.3+build'));
- throwsBadFormat(() => new Version.parse('1.3+bu?!3ild'));
+ expect(() => new Version.parse('1.0'), throwsFormatException);
+ expect(() => new Version.parse('1.2.3.4'), throwsFormatException);
+ expect(() => new Version.parse('1234'), throwsFormatException);
+ expect(() => new Version.parse('-2.3.4'), throwsFormatException);
+ expect(() => new Version.parse('1.3-pre'), throwsFormatException);
+ expect(() => new Version.parse('1.3+build'), throwsFormatException);
+ expect(() => new Version.parse('1.3+bu?!3ild'), throwsFormatException);
});
test('toString()', () {
@@ -370,9 +370,10 @@ main() {
});
test('throws FormatException on a bad string', () {
- throwsBadFormat(() => new VersionConstraint.parse(''));
- throwsBadFormat(() => new VersionConstraint.parse(' '));
- throwsBadFormat(() => new VersionConstraint.parse('not a version'));
+ expect(() => new VersionConstraint.parse(''), throwsFormatException);
+ expect(() => new VersionConstraint.parse(' '), throwsFormatException);
+ expect(() => new VersionConstraint.parse('not a version'),
+ throwsFormatException);
});
});
});
@@ -428,7 +429,3 @@ Matcher doesNotAllow(List<Version> versions) =>
throwsIllegalArg(function) {
expect(function, throwsA((e) => e is IllegalArgumentException));
}
-
-throwsBadFormat(function) {
- expect(function, throwsA((e) => e is FormatException));
-}
« no previous file with comments | « utils/tests/pub/test_pub.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698