| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.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 d.file. | 3 // BSD-style license that can be found in the LICENSE d.file. |
| 4 | 4 |
| 5 import 'dart:io'; | 5 import 'dart:io'; |
| 6 | 6 |
| 7 import 'package:path/path.dart' as path; | 7 import 'package:path/path.dart' as path; |
| 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("generates a symlink with a relative path if the dependency " | 20 integration( |
| 21 "path was relative", () { | 21 "generates a symlink with a relative path if the dependency " |
| 22 d.dir("foo", [ | 22 "path was relative", |
| 23 d.libDir("foo"), | 23 () { |
| 24 d.libPubspec("foo", "0.0.1") | 24 d.dir("foo", [d.libDir("foo"), d.libPubspec("foo", "0.0.1")]).create(); |
| 25 ]).create(); | |
| 26 | 25 |
| 27 d.dir(appPath, [ | 26 d.dir(appPath, [d.appPubspec({ |
| 28 d.appPubspec({ | 27 "foo": { |
| 29 "foo": {"path": "../foo"} | 28 "path": "../foo" |
| 30 }) | 29 } |
| 31 ]).create(); | 30 })]).create(); |
| 32 | 31 |
| 33 pubGet(); | 32 pubGet(); |
| 34 | 33 |
| 35 d.dir("moved").create(); | 34 d.dir("moved").create(); |
| 36 | 35 |
| 37 // Move the app and package. Since they are still next to each other, it | 36 // Move the app and package. Since they are still next to each other, it |
| 38 // should still be found. | 37 // should still be found. |
| 39 scheduleRename("foo", path.join("moved", "foo")); | 38 scheduleRename("foo", path.join("moved", "foo")); |
| 40 scheduleRename(appPath, path.join("moved", appPath)); | 39 scheduleRename(appPath, path.join("moved", appPath)); |
| 41 | 40 |
| 42 d.dir("moved", [ | 41 d.dir( |
| 43 d.dir(packagesPath, [ | 42 "moved", |
| 44 d.dir("foo", [ | 43 [ |
| 45 d.file("foo.dart", 'main() => "foo";') | 44 d.dir( |
| 46 ]) | 45 packagesPath, |
| 47 ]) | 46 [d.dir("foo", [d.file("foo.dart", 'main() => "foo";')])])]).vali
date(); |
| 48 ]).validate(); | |
| 49 }); | 47 }); |
| 50 } | 48 } |
| OLD | NEW |