| 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 // Dart test program for testing FileSystemEntity.resolveSymbolicLinks | 5 // Dart test program for testing FileSystemEntity.resolveSymbolicLinks |
| 6 | 6 |
| 7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 8 import "package:path/path.dart"; | 8 import "package:path/path.dart"; |
| 9 import "package:async_helper/async_helper.dart"; | 9 import "package:async_helper/async_helper.dart"; |
| 10 import 'dart:async'; | 10 import 'dart:async'; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 testLink('.'), | 73 testLink('.'), |
| 74 testDir('..'), | 74 testDir('..'), |
| 75 testLink('..\\link1')]); | 75 testLink('..\\link1')]); |
| 76 } else { | 76 } else { |
| 77 return Future.wait([ | 77 return Future.wait([ |
| 78 testFile('file2'), | 78 testFile('file2'), |
| 79 // On non-Windows the link is changed to dir1/dir2 before .. happens. | 79 // On non-Windows the link is changed to dir1/dir2 before .. happens. |
| 80 testFile('../dir2/file2'), | 80 testFile('../dir2/file2'), |
| 81 testDir('.'), | 81 testDir('.'), |
| 82 testDir('..'), | 82 testDir('..'), |
| 83 testDir('link1/.'), | |
| 84 testLink('../../link1')]); | 83 testLink('../../link1')]); |
| 85 } | 84 } |
| 86 }) | 85 }) |
| 87 .whenComplete(() { | 86 .whenComplete(() { |
| 88 Directory.current = testsDir; | 87 Directory.current = testsDir; |
| 89 tempDir.delete(recursive: true); | 88 tempDir.delete(recursive: true); |
| 90 }); | 89 }); |
| 91 })); | 90 })); |
| 92 } | 91 } |
| 93 | 92 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 Expect.isTrue(isAbsolute(resolved)); | 138 Expect.isTrue(isAbsolute(resolved)); |
| 140 // Test that resolveSymbolicLinks removes all links, .., and . segments. | 139 // Test that resolveSymbolicLinks removes all links, .., and . segments. |
| 141 Expect.isFalse(resolved.contains('..')); | 140 Expect.isFalse(resolved.contains('..')); |
| 142 Expect.isFalse(resolved.contains('./')); | 141 Expect.isFalse(resolved.contains('./')); |
| 143 Expect.isFalse(resolved.contains('link1')); | 142 Expect.isFalse(resolved.contains('link1')); |
| 144 return new Link(name).target() | 143 return new Link(name).target() |
| 145 .then((targetName) => FileSystemEntity.identical(targetName, resolved)) | 144 .then((targetName) => FileSystemEntity.identical(targetName, resolved)) |
| 146 .then((identical) => Expect.isTrue(identical)); | 145 .then((identical) => Expect.isTrue(identical)); |
| 147 }); | 146 }); |
| 148 } | 147 } |
| OLD | NEW |