OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library future_test; | 5 library future_test; |
6 | 6 |
7 import "package:expect/expect.dart"; | |
8 import 'dart:async'; | 7 import 'dart:async'; |
9 import 'dart:isolate'; | 8 import 'dart:isolate'; |
10 | 9 |
11 const Duration MS = const Duration(milliseconds: 1); | 10 const Duration MS = const Duration(milliseconds: 1); |
12 | 11 |
13 testImmediate() { | 12 testImmediate() { |
14 final future = new Future<String>.immediate("42"); | 13 final future = new Future<String>.immediate("42"); |
15 var port = new ReceivePort(); | 14 var port = new ReceivePort(); |
16 future.then((x) { | 15 future.then((x) { |
17 Expect.equals("42", x); | 16 Expect.equals("42", x); |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 testFutureCatchThrowsAsync(); | 642 testFutureCatchThrowsAsync(); |
644 testFutureWhenThrowsAsync(); | 643 testFutureWhenThrowsAsync(); |
645 testFutureCatchRethrowsAsync(); | 644 testFutureCatchRethrowsAsync(); |
646 | 645 |
647 testChainedFutureValue(); | 646 testChainedFutureValue(); |
648 testChainedFutureValueDelay(); | 647 testChainedFutureValueDelay(); |
649 testChainedFutureError(); | 648 testChainedFutureError(); |
650 } | 649 } |
651 | 650 |
652 | 651 |
OLD | NEW |