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

Unified Diff: tests/language/type_error_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/language/null_bottom_test.dart ('k') | tools/testing/dart/configuration.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/type_error_test.dart
diff --git a/tests/language/type_error_test.dart b/tests/language/type_error_test.dart
index fc62c23b936709710aef4246c03d3eb91bf3e087..96c42abdfd1820262fda548ee97b4add052dc8e2 100644
--- a/tests/language/type_error_test.dart
+++ b/tests/language/type_error_test.dart
@@ -132,10 +132,10 @@ checkTypeError(o) {
print(o);
} on TypeError catch (e) {
print(e); // This might provoke an error.
- if (assertionsEnabled) return; // Expected type error.
+ if (typeAssertionsEnabled) return; // Expected type error.
rethrow; // Rethrow unexpected type error.
}
- if (assertionsEnabled) {
+ if (typeAssertionsEnabled) {
throw 'expected TypeError';
}
}
@@ -145,7 +145,7 @@ checkAssert(o) {
assert(o);
} on TypeError catch (e) {
print(e); // This might provoke an error.
- if (!assertionsEnabled) rethrow; // Unexpected error.
+ if (!assertStatementsEnabled) rethrow; // Unexpected error.
}
}
@@ -162,11 +162,7 @@ checkCastError(o) {
throw 'expected CastError';
}
-bool assertionsEnabled = false;
-
main() {
- assert(assertionsEnabled = true);
-
checkTypeError(new IntTypeError());
checkTypeError(new StringTypeError());
checkTypeError(new DoubleTypeError());
« no previous file with comments | « tests/language/null_bottom_test.dart ('k') | tools/testing/dart/configuration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698