| 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 library pub_tests; | 5 library pub_tests; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import '../descriptor.dart' as d; | 9 import '../descriptor.dart' as d; |
| 10 import '../test_pub.dart'; | 10 import '../test_pub.dart'; |
| 11 | 11 |
| 12 main() { | 12 main() { |
| 13 // Pub uses NTFS junction points to create links in the packages directory. | 13 // Pub uses NTFS junction points to create links in the packages directory. |
| 14 // These (unlike the symlinks that are supported in Vista and later) do not | 14 // These (unlike the symlinks that are supported in Vista and later) do not |
| 15 // support relative paths. So this test, by design, will not pass on Windows. | 15 // support relative paths. So this test, by design, will not pass on Windows. |
| 16 // So just skip it. | 16 // So just skip it. |
| 17 if (Platform.operatingSystem == "windows") return; | 17 if (Platform.operatingSystem == "windows") return; |
| 18 | 18 |
| 19 initConfig(); | 19 initConfig(); |
| 20 integration('uses a relative symlink for the self link', () { | 20 integration('uses a relative symlink for the self link', () { |
| 21 d.dir(appPath, [ | 21 d.dir(appPath, [d.appPubspec(), d.libDir('foo')]).create(); |
| 22 d.appPubspec(), | |
| 23 d.libDir('foo') | |
| 24 ]).create(); | |
| 25 | 22 |
| 26 pubGet(); | 23 pubGet(); |
| 27 | 24 |
| 28 scheduleRename(appPath, "moved"); | 25 scheduleRename(appPath, "moved"); |
| 29 | 26 |
| 30 d.dir("moved", [ | 27 d.dir( |
| 31 d.dir("packages", [ | 28 "moved", |
| 32 d.dir("myapp", [ | 29 [ |
| 33 d.file('foo.dart', 'main() => "foo";') | 30 d.dir( |
| 34 ]) | 31 "packages", |
| 35 ]) | 32 [d.dir("myapp", [d.file('foo.dart', 'main() => "foo";')])])]).va
lidate(); |
| 36 ]).validate(); | |
| 37 }); | 33 }); |
| 38 | 34 |
| 39 integration('uses a relative symlink for secondary packages directory', () { | 35 integration('uses a relative symlink for secondary packages directory', () { |
| 40 d.dir(appPath, [ | 36 d.dir(appPath, [d.appPubspec(), d.libDir('foo'), d.dir("bin")]).create(); |
| 41 d.appPubspec(), | |
| 42 d.libDir('foo'), | |
| 43 d.dir("bin") | |
| 44 ]).create(); | |
| 45 | 37 |
| 46 pubGet(); | 38 pubGet(); |
| 47 | 39 |
| 48 scheduleRename(appPath, "moved"); | 40 scheduleRename(appPath, "moved"); |
| 49 | 41 |
| 50 d.dir("moved", [ | 42 d.dir( |
| 51 d.dir("bin", [ | 43 "moved", |
| 52 d.dir("packages", [ | 44 [ |
| 53 d.dir("myapp", [ | 45 d.dir( |
| 54 d.file('foo.dart', 'main() => "foo";') | 46 "bin", |
| 55 ]) | 47 [ |
| 56 ]) | 48 d.dir( |
| 57 ]) | 49 "packages", |
| 58 ]).validate(); | 50 [d.dir("myapp", [d.file('foo.dart', 'main() => "foo";')]
)])])]).validate(); |
| 59 }); | 51 }); |
| 60 } | 52 } |
| OLD | NEW |