| 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 import "dart:isolate"; | 8 import "dart:isolate"; |
| 9 | 9 |
| 10 // Test the dart:io Link class. | 10 // Test the dart:io Link class. |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 .last) | 166 .last) |
| 167 .then((_) => | 167 .then((_) => |
| 168 // This directory listing must terminate, even though it contains loops. | 168 // This directory listing must terminate, even though it contains loops. |
| 169 new Directory.fromPath(base.append('a/b/c')) | 169 new Directory.fromPath(base.append('a/b/c')) |
| 170 .list(recursive: true, followLinks: true) | 170 .list(recursive: true, followLinks: true) |
| 171 .last) | 171 .last) |
| 172 .then((_) => | 172 .then((_) => |
| 173 new Directory.fromPath(base).delete(recursive: true)); | 173 new Directory.fromPath(base).delete(recursive: true)); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void testLinkErrorSync() { |
| 177 Expect.throws(() => |
| 178 new Link('some-dir-that-doent exist/some link file/bla/fisk').createSync( |
| 179 'bla bla bla/b lalal/blfir/sdfred/es'), |
| 180 (e) => e is LinkException); |
| 181 } |
| 182 |
| 176 main() { | 183 main() { |
| 177 testCreateSync(); | 184 testCreateSync(); |
| 178 testCreateLoopingLink(); | 185 testCreateLoopingLink(); |
| 186 testLinkErrorSync(); |
| 179 } | 187 } |
| OLD | NEW |