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

Unified Diff: tests/corelib/int_parse_radix_test.dart

Issue 2879153005: Add support to dart2js for option --enable-asserts. (Closed)
Patch Set: Added !$checked to section predicate in co19 status file Created 3 years, 5 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/co19/co19-dart2js.status ('k') | tests/corelib/iterable_generate_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/int_parse_radix_test.dart
diff --git a/tests/corelib/int_parse_radix_test.dart b/tests/corelib/int_parse_radix_test.dart
index 9473631bebbf955ebdb998988cd04fd6ac07e1b6..0757b960ebf540c505b4034e74d5babb6ff85a65 100644
--- a/tests/corelib/int_parse_radix_test.dart
+++ b/tests/corelib/int_parse_radix_test.dart
@@ -6,8 +6,6 @@ import "package:expect/expect.dart";
import "dart:math" show pow;
void main() {
- bool checkedMode = false;
- assert((checkedMode = true));
const String oneByteWhiteSpace = "\x09\x0a\x0b\x0c\x0d\x20"
"\x85" // //# 01: ok
"\xa0";
@@ -116,13 +114,13 @@ void main() {
}
testBadTypes(var source, var radix) {
- if (!checkedMode) {
+ 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;
}
- // In checked mode, it's always a TypeError.
+ // 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);
}
« no previous file with comments | « tests/co19/co19-dart2js.status ('k') | tests/corelib/iterable_generate_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698