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

Unified Diff: tests/corelib_2/int_parse_radix_test.dart

Issue 2997533002: Migrate test block 10 to Dart 2.0. (Closed)
Patch Set: Fix merge error Created 3 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 | « tests/corelib_2/int_parse_radix_bad_handler_test.dart ('k') | tests/corelib_2/int_round_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib_2/int_parse_radix_test.dart
diff --git a/tests/corelib/int_parse_radix_test.dart b/tests/corelib_2/int_parse_radix_test.dart
similarity index 92%
rename from tests/corelib/int_parse_radix_test.dart
rename to tests/corelib_2/int_parse_radix_test.dart
index 0757b960ebf540c505b4034e74d5babb6ff85a65..d61118f062cc88c067648a57455a3b7569eddad5 100644
--- a/tests/corelib/int_parse_radix_test.dart
+++ b/tests/corelib_2/int_parse_radix_test.dart
@@ -7,7 +7,7 @@ import "dart:math" show pow;
void main() {
const String oneByteWhiteSpace = "\x09\x0a\x0b\x0c\x0d\x20"
- "\x85" // //# 01: ok
+ "\x85" //# 01: ok
"\xa0";
const String whiteSpace = "$oneByteWhiteSpace\u1680"
"\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a"
@@ -114,15 +114,8 @@ void main() {
}
testBadTypes(var source, var radix) {
- if (!typeAssertionsEnabled) {
- // No promises on what error is thrown if the type doesn't match.
- // Likely either ArgumentError or NoSuchMethodError.
- Expect.throws(() => int.parse(source, radix: radix, onError: (s) => 0));
- return;
- }
- // With type assertions enabled we can be more precise.
- Expect.throws(() => int.parse(source, radix: radix, onError: (s) => 0),
- (e) => e is TypeError || e is CastError);
+ Expect.throws(() => int.parse(source, radix: radix, onError: (s) => 0), //# badTypes: ok
+ (e) => e is TypeError); //# badTypes: ok
}
testBadTypes(9, 10);
« no previous file with comments | « tests/corelib_2/int_parse_radix_bad_handler_test.dart ('k') | tests/corelib_2/int_round_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698