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

Unified Diff: pkg/dev_compiler/test/browser/runtime_tests.js

Issue 2789933002: Add runtime tests for ignored checks (Closed)
Patch Set: Created 3 years, 9 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 | « pkg/dev_compiler/test/browser/language_tests.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/test/browser/runtime_tests.js
diff --git a/pkg/dev_compiler/test/browser/runtime_tests.js b/pkg/dev_compiler/test/browser/runtime_tests.js
index acce540dd37d1bf196577a5ffb2578878ac2fd71..6ed5f16ca2c20929172d3a06e232e8de50fc3f3b 100644
--- a/pkg/dev_compiler/test/browser/runtime_tests.js
+++ b/pkg/dev_compiler/test/browser/runtime_tests.js
@@ -10,6 +10,35 @@ define(['dart_sdk'], function(dart_sdk) {
const dart = dart_sdk.dart;
const dartx = dart.dartx;
+ dart.trapRuntimeErrors(false);
+
+ suite('ignore', () => {
+ "use strict";
+
+ let FutureOr = async.FutureOr$;
+ let Future = async.Future$;
+ let List = core.List$;
+
+ setup(() => {
+ dart_sdk.dart.ignoreWhitelistedErrors(false);
+ });
+
+ teardown(() => {
+ dart_sdk.dart.ignoreWhitelistedErrors(false);
+ });
+
+ test('FutureOr', () => {
+ let f = Future(dart.dynamic).value(42);
+ let l = [1, 2, 3];
+
+ assert.throws(() => { dart.as(f, FutureOr(core.int)); });
+ assert.throws(() => { dart.as(l, FutureOr(List(core.int)))});
+
+ dart_sdk.dart.ignoreWhitelistedErrors(true);
+ assert.equal(f, dart.as(f, FutureOr(core.int)));
+ assert.equal(l, dart.as(l, FutureOr(List(core.int))));
+ });
+ });
suite('generic', () => {
"use strict";
« no previous file with comments | « pkg/dev_compiler/test/browser/language_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698