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 '../../../../../pkg/path/lib/path.dart' as path; | 5 import '../../../../../pkg/path/lib/path.dart' as path; |
6 | 6 |
| 7 import '../../../../pub/exit_codes.dart' as exit_codes; |
7 import '../../test_pub.dart'; | 8 import '../../test_pub.dart'; |
8 | 9 |
9 main() { | 10 main() { |
10 initConfig(); | 11 initConfig(); |
11 integration('path dependency with absolute path', () { | 12 integration("generates a symlink with a relative path", () { |
12 dir('foo', [ | 13 dir("foo", [ |
13 libDir('foo'), | 14 libDir("foo"), |
14 libPubspec('foo', '0.0.1') | 15 libPubspec("foo", "0.0.1") |
15 ]).scheduleCreate(); | 16 ]).scheduleCreate(); |
16 | 17 |
17 dir(appPath, [ | 18 dir(appPath, [ |
18 pubspec({ | 19 pubspec({ |
19 "name": "myapp", | 20 "name": "myapp", |
20 "dependencies": { | 21 "dependencies": { |
21 "foo": {"path": path.join(sandboxDir, "foo")} | 22 "foo": {"path": "../foo"} |
22 } | 23 } |
23 }) | 24 }) |
24 ]).scheduleCreate(); | 25 ]).scheduleCreate(); |
25 | 26 |
26 schedulePub(args: ["install"], | 27 schedulePub(args: ["install"], |
27 output: new RegExp(r"Dependencies installed!$")); | 28 output: new RegExp(r"Dependencies installed!$")); |
28 | 29 |
29 dir(packagesPath, [ | 30 dir("moved").scheduleCreate(); |
30 dir("foo", [ | |
31 file("foo.dart", 'main() => "foo";') | |
32 ]) | |
33 ]).scheduleValidate(); | |
34 | 31 |
35 // Move the packages directory and ensure the symlink still works. That | 32 // Move the app and package. Since they are still next to each other, it |
36 // will validate that we actually created an absolute symlink. | 33 // should still be found. |
37 dir("moved").scheduleCreate(); | 34 scheduleRename("foo", path.join("moved", "foo")); |
38 scheduleRename(packagesPath, "moved/packages"); | 35 scheduleRename(appPath, path.join("moved", appPath)); |
39 | 36 |
40 dir("moved/packages", [ | 37 dir("moved", [ |
41 dir("foo", [ | 38 dir(packagesPath, [ |
42 file("foo.dart", 'main() => "foo";') | 39 dir("foo", [ |
| 40 file("foo.dart", 'main() => "foo";') |
| 41 ]) |
43 ]) | 42 ]) |
44 ]).scheduleValidate(); | 43 ]).scheduleValidate(); |
45 }); | 44 }); |
46 } | 45 } |
OLD | NEW |