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

Unified Diff: tests/corelib/splay_tree_from_iterable_test.dart

Issue 2879153005: Add support to dart2js for option --enable-asserts. (Closed)
Patch Set: Adjusted the status of two tests and the logic of one test, to make them work with --enable-asserts Created 3 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
Index: tests/corelib/splay_tree_from_iterable_test.dart
diff --git a/tests/corelib/splay_tree_from_iterable_test.dart b/tests/corelib/splay_tree_from_iterable_test.dart
index c60293a1eed5a7bd9a33d3d124b0eec40cc59b92..70f30baa1e7f24104c7ecd8554f72290ffa9b8fb 100644
--- a/tests/corelib/splay_tree_from_iterable_test.dart
+++ b/tests/corelib/splay_tree_from_iterable_test.dart
@@ -119,10 +119,18 @@ void genericTypeTest() {
Expect.isFalse(map is SplayTreeMap<dynamic, int>);
}
+final bool isCheckedMode = (() {
+ try {
+ var i = 42;
+ String s = i;
+ } on TypeError catch (e) {
+ return true;
+ }
+ return false;
+})();
+
// Test in checked mode with explicitly given types.
void typedTest() {
- bool isCheckedMode = false;
- assert((isCheckedMode = true));
if (!isCheckedMode) return;
// Assign functions to untyped function variables.

Powered by Google App Engine
This is Rietveld 408576698