| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import "dart:async"; |
| 6 import "dart:io"; |
| 7 |
| 8 import "package:async_helper/async_helper.dart"; |
| 5 import "package:expect/expect.dart"; | 9 import "package:expect/expect.dart"; |
| 6 import "package:path/path.dart"; | 10 import "package:path/path.dart"; |
| 7 import "dart:async"; | |
| 8 import "dart:io"; | |
| 9 import "dart:isolate"; | |
| 10 | 11 |
| 11 // Test the dart:io Link class. | 12 // Test the dart:io Link class. |
| 12 | 13 |
| 13 class FutureExpect { | 14 class FutureExpect { |
| 14 static Future isTrue(Future<bool> result) => | 15 static Future isTrue(Future<bool> result) => |
| 15 result.then((value) => Expect.isTrue(value)); | 16 result.then((value) => Expect.isTrue(value)); |
| 16 static Future isFalse(Future<bool> result) => | 17 static Future isFalse(Future<bool> result) => |
| 17 result.then((value) => Expect.isFalse(value)); | 18 result.then((value) => Expect.isFalse(value)); |
| 18 static Future equals(expected, Future result) => | 19 static Future equals(expected, Future result) => |
| 19 result.then((value) => Expect.equals(expected, value)); | 20 result.then((value) => Expect.equals(expected, value)); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 Expect.equals('Found', v); | 265 Expect.equals('Found', v); |
| 265 } | 266 } |
| 266 }) | 267 }) |
| 267 ); | 268 ); |
| 268 } | 269 } |
| 269 } | 270 } |
| 270 return Future.wait(futures); | 271 return Future.wait(futures); |
| 271 } | 272 } |
| 272 | 273 |
| 273 main() { | 274 main() { |
| 274 ReceivePort keepAlive = new ReceivePort(); | 275 asyncStart(); |
| 275 testCreate() | 276 testCreate() |
| 276 .then((_) => testCreateLoopingLink()) | 277 .then((_) => testCreateLoopingLink()) |
| 277 .then((_) => testRename()) | 278 .then((_) => testRename()) |
| 278 .then((_) => keepAlive.close()); | 279 .then((_) => asyncEnd()); |
| 279 } | 280 } |
| OLD | NEW |