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

Unified Diff: test/codegen/corelib/int_parse_radix_test.dart

Issue 1950133008: Update number parsing. (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: Created 4 years, 7 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 | « test/browser/language_tests.js ('k') | tool/input_sdk/lib/core/list.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/corelib/int_parse_radix_test.dart
diff --git a/test/codegen/corelib/int_parse_radix_test.dart b/test/codegen/corelib/int_parse_radix_test.dart
index fbe920582178303a88e1155d5ccbd86fcd040d19..03af52864ce1ce6919a6b201f0ea28690a8e4c4d 100644
--- a/test/codegen/corelib/int_parse_radix_test.dart
+++ b/test/codegen/corelib/int_parse_radix_test.dart
@@ -7,7 +7,7 @@ import "dart:math" show pow;
void main() {
bool checkedMode = false;
- assert(checkedMode = true);
+ assert((checkedMode = true));
const String oneByteWhiteSpace = "\x09\x0a\x0b\x0c\x0d\x20"
"\x85" /// 01: ok
"\xa0";
@@ -116,7 +116,7 @@ void main() {
}
// In checked mode, it's always a TypeError.
Expect.throws(() => int.parse(source, radix: radix, onError: (s) => 0),
- (e) => e is TypeError);
+ (e) => e is TypeError || e is CastError);
}
testBadTypes(9, 10);
@@ -135,11 +135,7 @@ void main() {
testBadArguments("0", 1);
testBadArguments("0", 37);
- // If handleError isn't an unary function, and it's called, it also throws
- // (either TypeError in checked mode, or some failure in unchecked mode).
- Expect.throws(() => int.parse("9", radix: 8, onError: "not a function"));
- Expect.throws(() => int.parse("9", radix: 8, onError: () => 42));
- Expect.throws(() => int.parse("9", radix: 8, onError: (v1, v2) => 42));
+ // See also int_parse_radix_bad_handler_test.dart
}
bool isFail(e) => e == "FAIL";
« no previous file with comments | « test/browser/language_tests.js ('k') | tool/input_sdk/lib/core/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698