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 'package:path/path.dart' as path; | 5 import 'package:path/path.dart' as path; |
6 | 6 |
7 import '../../../lib/src/exit_codes.dart' as exit_codes; | 7 import '../../../lib/src/exit_codes.dart' as exit_codes; |
8 import '../../descriptor.dart' as d; | 8 import '../../descriptor.dart' as d; |
9 import '../../test_pub.dart'; | 9 import '../../test_pub.dart'; |
10 | 10 |
11 main() { | 11 main() { |
12 initConfig(); | 12 initConfig(); |
13 integration("generates a symlink with an absolute path if the dependency " | 13 integration("generates a symlink with an absolute path if the dependency " |
14 "path was absolute", () { | 14 "path was absolute", () { |
15 d.dir("foo", [ | 15 d.dir("foo", [ |
16 d.libDir("foo"), | 16 d.libDir("foo"), |
17 d.libPubspec("foo", "0.0.1") | 17 d.libPubspec("foo", "0.0.1") |
18 ]).create(); | 18 ]).create(); |
19 | 19 |
20 d.dir(appPath, [ | 20 d.dir(appPath, [ |
21 d.pubspec({ | 21 d.appPubspec({ |
22 "name": "myapp", | 22 "foo": {"path": path.join(sandboxDir, "foo")} |
23 "dependencies": { | |
24 "foo": {"path": path.join(sandboxDir, "foo")} | |
25 } | |
26 }) | 23 }) |
27 ]).create(); | 24 ]).create(); |
28 | 25 |
29 pubInstall(); | 26 pubInstall(); |
30 | 27 |
31 d.dir("moved").create(); | 28 d.dir("moved").create(); |
32 | 29 |
33 // Move the app but not the package. Since the symlink is absolute, it | 30 // Move the app but not the package. Since the symlink is absolute, it |
34 // should still be able to find it. | 31 // should still be able to find it. |
35 scheduleRename(appPath, path.join("moved", appPath)); | 32 scheduleRename(appPath, path.join("moved", appPath)); |
36 | 33 |
37 d.dir("moved", [ | 34 d.dir("moved", [ |
38 d.dir(packagesPath, [ | 35 d.dir(packagesPath, [ |
39 d.dir("foo", [ | 36 d.dir("foo", [ |
40 d.file("foo.dart", 'main() => "foo";') | 37 d.file("foo.dart", 'main() => "foo";') |
41 ]) | 38 ]) |
42 ]) | 39 ]) |
43 ]).validate(); | 40 ]).validate(); |
44 }); | 41 }); |
45 } | 42 } |
OLD | NEW |