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:io"; | 5 import "dart:io"; |
6 import "dart:isolate"; | 6 import "dart:isolate"; |
7 | 7 |
8 | 8 |
9 createLink(String dst, String link, void callback()) { | 9 createLink(String dst, String link, void callback()) { |
10 new Link(link).create(dst).then((_) => callback()); | 10 new Link(link).create(dst).then((_) => callback()); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 Expect.isTrue(FileSystemEntity.isDirectorySync(y)); | 50 Expect.isTrue(FileSystemEntity.isDirectorySync(y)); |
51 Expect.isTrue(FileSystemEntity.isDirectorySync(x)); | 51 Expect.isTrue(FileSystemEntity.isDirectorySync(x)); |
52 Expect.equals(FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(y)); | 52 Expect.equals(FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(y)); |
53 Expect.equals(FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(x)); | 53 Expect.equals(FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(x)); |
54 Expect.equals(FileSystemEntityType.LINK, | 54 Expect.equals(FileSystemEntityType.LINK, |
55 FileSystemEntity.typeSync(y, followLinks: false)); | 55 FileSystemEntity.typeSync(y, followLinks: false)); |
56 Expect.equals(FileSystemEntityType.DIRECTORY, | 56 Expect.equals(FileSystemEntityType.DIRECTORY, |
57 FileSystemEntity.typeSync(x, followLinks: false)); | 57 FileSystemEntity.typeSync(x, followLinks: false)); |
58 Expect.equals(x, new Link(y).targetSync()); | 58 Expect.equals(x, new Link(y).targetSync()); |
59 | 59 |
60 new File(y).deleteSync(); | 60 new Link(y).deleteSync(); |
61 Expect.isFalse(FileSystemEntity.isLinkSync(y)); | 61 Expect.isFalse(FileSystemEntity.isLinkSync(y)); |
62 Expect.isFalse(FileSystemEntity.isLinkSync(x)); | 62 Expect.isFalse(FileSystemEntity.isLinkSync(x)); |
63 Expect.equals(FileSystemEntityType.NOT_FOUND, FileSystemEntity.typeSync(y)); | 63 Expect.equals(FileSystemEntityType.NOT_FOUND, FileSystemEntity.typeSync(y)); |
64 Expect.equals(FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(x)); | 64 Expect.equals(FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(x)); |
65 Expect.throws(() => new Link(y).targetSync()); | 65 Expect.throws(() => new Link(y).targetSync()); |
66 | 66 |
67 temp.deleteSync(recursive: true); | 67 temp.deleteSync(recursive: true); |
68 }); | 68 }); |
69 } | 69 } |
70 | 70 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 main() { | 240 main() { |
241 testFileExistsCreate(); | 241 testFileExistsCreate(); |
242 testFileDelete(); | 242 testFileDelete(); |
243 testFileWriteRead(); | 243 testFileWriteRead(); |
244 testDirectoryExistsCreate(); | 244 testDirectoryExistsCreate(); |
245 testDirectoryDelete(); | 245 testDirectoryDelete(); |
246 testDirectoryListing(); | 246 testDirectoryListing(); |
247 testDirectoryListingBrokenLink(); | 247 testDirectoryListingBrokenLink(); |
248 } | 248 } |
OLD | NEW |