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 // 'fuzz' test the directory APIs by providing unexpected type | 5 // 'fuzz' test the directory APIs by providing unexpected type |
6 // arguments. The test passes if the VM does not crash. | 6 // arguments. The test passes if the VM does not crash. |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 import 'dart:isolate'; | 10 import 'dart:isolate'; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 futures.add(doItAsync(() { | 52 futures.add(doItAsync(() { |
53 return d.exists().then((res) { | 53 return d.exists().then((res) { |
54 if (!res) return d.delete(recursive: true); | 54 if (!res) return d.delete(recursive: true); |
55 return new Future.immediate(true); | 55 return new Future.immediate(true); |
56 }); | 56 }); |
57 })); | 57 })); |
58 typeMapping.forEach((k2, v2) { | 58 typeMapping.forEach((k2, v2) { |
59 futures.add(doItAsync(() => d.rename(v2))); | 59 futures.add(doItAsync(() => d.rename(v2))); |
60 }); | 60 }); |
61 }); | 61 }); |
62 Futures.wait(futures).then((ignore) => port.close()); | 62 Future.wait(futures).then((ignore) => port.close()); |
63 } | 63 } |
64 | 64 |
65 main() { | 65 main() { |
66 fuzzSyncMethods(); | 66 fuzzSyncMethods(); |
67 fuzzAsyncMethods(); | 67 fuzzAsyncMethods(); |
68 } | 68 } |
OLD | NEW |