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 3cb562aff0a9c56993f84bc34d6f72d67b77e3f2..acce540dd37d1bf196577a5ffb2578878ac2fd71 100644 |
--- a/pkg/dev_compiler/test/browser/runtime_tests.js |
+++ b/pkg/dev_compiler/test/browser/runtime_tests.js |
@@ -132,6 +132,7 @@ define(['dart_sdk'], function(dart_sdk) { |
let List = core.List; |
let Map = core.Map; |
let Map$ = core.Map$; |
+ let double = core.double; |
let int = core.int; |
let num = core.num; |
let bool = core.bool; |
@@ -283,6 +284,23 @@ define(['dart_sdk'], function(dart_sdk) { |
expect(cast(null, String), null); |
}); |
+ test('FutureOr', () => { |
+ let FutureOr = async.FutureOr$; |
+ |
+ assert.equal(dart.as(3, FutureOr(int)), 3); |
+ assert.equal(dart.as(3, FutureOr(double)), 3); |
+ assert.throws(() => dart.as(3.5, FutureOr(int))); |
+ assert.equal(dart.as(3.5, FutureOr(double)), 3.5); |
+ assert.isTrue(dart.is(3, FutureOr(int))); |
+ assert.isTrue(dart.is(3, FutureOr(double))); |
+ assert.isFalse(dart.is(3.5, FutureOr(int))); |
+ assert.isTrue(dart.is(3.5, FutureOr(double))); |
+ |
+ assert.equal(dart.as(3, FutureOr(FutureOr(double))), 3); |
+ assert.isTrue(dart.is(3, FutureOr(FutureOr(double)))); |
+ |
+ }); |
+ |
test('Map', () => { |
let m1 = new (Map$(String, String))(); |
let m2 = new (Map$(Object, Object))(); |