| 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"; | 5 import "dart:async"; |
| 6 import 'package:expect/expect.dart'; | |
| 7 import "dart:io"; | 6 import "dart:io"; |
| 8 import "dart:isolate"; | 7 |
| 8 import "package:async_helper/async_helper.dart"; |
| 9 import "package:expect/expect.dart"; |
| 9 | 10 |
| 10 | 11 |
| 11 class FutureExpect { | 12 class FutureExpect { |
| 12 static Future isTrue(Future<bool> result) => | 13 static Future isTrue(Future<bool> result) => |
| 13 result.then((value) => Expect.isTrue(value)); | 14 result.then((value) => Expect.isTrue(value)); |
| 14 static Future isFalse(Future<bool> result) => | 15 static Future isFalse(Future<bool> result) => |
| 15 result.then((value) => Expect.isFalse(value)); | 16 result.then((value) => Expect.isFalse(value)); |
| 16 static Future equals(expected, Future result) => | 17 static Future equals(expected, Future result) => |
| 17 result.then((value) => Expect.equals(expected, value)); | 18 result.then((value) => Expect.equals(expected, value)); |
| 18 static Future listEquals(expected, Future result) => | 19 static Future listEquals(expected, Future result) => |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 FileSystemEntity.type(x, followLinks: false))) | 93 FileSystemEntity.type(x, followLinks: false))) |
| 93 .then((_) => FutureExpect.throws(new Link(y).target())) | 94 .then((_) => FutureExpect.throws(new Link(y).target())) |
| 94 .then((_) => temp.delete(recursive: true)); | 95 .then((_) => temp.delete(recursive: true)); |
| 95 }); | 96 }); |
| 96 } | 97 } |
| 97 | 98 |
| 98 | 99 |
| 99 main() { | 100 main() { |
| 100 // Links on other platforms are tested by file_system_[async_]links_test. | 101 // Links on other platforms are tested by file_system_[async_]links_test. |
| 101 if (Platform.operatingSystem == 'windows') { | 102 if (Platform.operatingSystem == 'windows') { |
| 102 ReceivePort keepAlive = new ReceivePort(); | 103 asyncStart(); |
| 103 testJunctionTypeDelete().then((_) => keepAlive.close()); | 104 testJunctionTypeDelete().then((_) => asyncEnd()); |
| 104 } | 105 } |
| 105 } | 106 } |
| OLD | NEW |