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 "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 import "dart:async"; | 6 import "dart:async"; |
7 import "dart:io"; | 7 import "dart:io"; |
8 | 8 |
9 Future throws(callback()) { | 9 Future throws(callback()) { |
10 return new Future.immediate(null) | 10 return new Future.value() |
11 .then((_) => callback()) | 11 .then((_) => callback()) |
12 .then((_) { throw "Expected error"; }, | 12 .then((_) { throw "Expected error"; }, |
13 onError: (_) {}); | 13 onError: (_) {}); |
14 } | 14 } |
15 | 15 |
16 void testDeleteFileSync() { | 16 void testDeleteFileSync() { |
17 var tmp = new Directory("").createTempSync(); | 17 var tmp = new Directory("").createTempSync(); |
18 var path = "${tmp.path}${Platform.pathSeparator}"; | 18 var path = "${tmp.path}${Platform.pathSeparator}"; |
19 | 19 |
20 var file = new File("${path}myFile"); | 20 var file = new File("${path}myFile"); |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 testDeleteDirectory(); | 398 testDeleteDirectory(); |
399 if (Platform.operatingSystem != 'windows') { | 399 if (Platform.operatingSystem != 'windows') { |
400 testDeleteFileLinkSync(); | 400 testDeleteFileLinkSync(); |
401 testDeleteFileLink(); | 401 testDeleteFileLink(); |
402 } | 402 } |
403 testDeleteDirectoryLinkSync(); | 403 testDeleteDirectoryLinkSync(); |
404 testDeleteDirectoryLink(); | 404 testDeleteDirectoryLink(); |
405 testDeleteBrokenLinkSync(); | 405 testDeleteBrokenLinkSync(); |
406 testDeleteBrokenLink(); | 406 testDeleteBrokenLink(); |
407 } | 407 } |
OLD | NEW |