| 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 testJunctionTypeDelete() { | 8 testJunctionTypeDelete() { |
| 9 var temp = new Directory('').createTempSync(); | 9 var temp = new Directory('').createTempSync(); |
| 10 var x = '${temp.path}${Platform.pathSeparator}x'; | 10 var x = '${temp.path}${Platform.pathSeparator}x'; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 Expect.equals(FileSystemEntityType.LINK, | 25 Expect.equals(FileSystemEntityType.LINK, |
| 26 FileSystemEntity.typeSync(y, followLinks: false)); | 26 FileSystemEntity.typeSync(y, followLinks: false)); |
| 27 Expect.equals(FileSystemEntityType.DIRECTORY, | 27 Expect.equals(FileSystemEntityType.DIRECTORY, |
| 28 FileSystemEntity.typeSync(x, followLinks: false)); | 28 FileSystemEntity.typeSync(x, followLinks: false)); |
| 29 // Test Junction pointing to a missing directory. | 29 // Test Junction pointing to a missing directory. |
| 30 new Directory(x).deleteSync(); | 30 new Directory(x).deleteSync(); |
| 31 Expect.isTrue(new Directory(y).existsSync()); | 31 Expect.isTrue(new Directory(y).existsSync()); |
| 32 Expect.isFalse(new Directory(x).existsSync()); | 32 Expect.isFalse(new Directory(x).existsSync()); |
| 33 Expect.isTrue(FileSystemEntity.isLinkSync(y)); | 33 Expect.isTrue(FileSystemEntity.isLinkSync(y)); |
| 34 Expect.isFalse(FileSystemEntity.isLinkSync(x)); | 34 Expect.isFalse(FileSystemEntity.isLinkSync(x)); |
| 35 Expect.isTrue(FileSystemEntity.isDirectorySync(y)); | 35 Expect.isFalse(FileSystemEntity.isDirectorySync(y)); |
| 36 Expect.isFalse(FileSystemEntity.isDirectorySync(x)); | 36 Expect.isFalse(FileSystemEntity.isDirectorySync(x)); |
| 37 Expect.equals(FileSystemEntityType.DIRECTORY, | 37 Expect.equals(FileSystemEntityType.NOT_FOUND, |
| 38 FileSystemEntity.typeSync(y)); | 38 FileSystemEntity.typeSync(y)); |
| 39 Expect.equals(FileSystemEntityType.NOT_FOUND, | 39 Expect.equals(FileSystemEntityType.NOT_FOUND, |
| 40 FileSystemEntity.typeSync(x)); | 40 FileSystemEntity.typeSync(x)); |
| 41 Expect.equals(FileSystemEntityType.LINK, | 41 Expect.equals(FileSystemEntityType.LINK, |
| 42 FileSystemEntity.typeSync(y, followLinks: false)); | 42 FileSystemEntity.typeSync(y, followLinks: false)); |
| 43 Expect.equals(FileSystemEntityType.NOT_FOUND, | 43 Expect.equals(FileSystemEntityType.NOT_FOUND, |
| 44 FileSystemEntity.typeSync(x, followLinks: false)); | 44 FileSystemEntity.typeSync(x, followLinks: false)); |
| 45 | 45 |
| 46 // Delete Junction pointing to a missing directory. | 46 // Delete Junction pointing to a missing directory. |
| 47 new Directory(y).deleteSync(); | 47 new Directory(y).deleteSync(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 70 }); | 70 }); |
| 71 }); | 71 }); |
| 72 } | 72 } |
| 73 | 73 |
| 74 | 74 |
| 75 main() { | 75 main() { |
| 76 if (Platform.operatingSystem == 'windows') { | 76 if (Platform.operatingSystem == 'windows') { |
| 77 testJunctionTypeDelete(); | 77 testJunctionTypeDelete(); |
| 78 } | 78 } |
| 79 } | 79 } |
| OLD | NEW |