| 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 an absolute path if the dependency " |
| 12 dir('foo', [ | 13 "path was absolute", () { |
| 13 libDir('foo'), | 14 dir("foo", [ |
| 14 libPubspec('foo', '0.0.1') | 15 libDir("foo"), |
| 16 libPubspec("foo", "0.0.1") |
| 15 ]).scheduleCreate(); | 17 ]).scheduleCreate(); |
| 16 | 18 |
| 17 dir(appPath, [ | 19 dir(appPath, [ |
| 18 pubspec({ | 20 pubspec({ |
| 19 "name": "myapp", | 21 "name": "myapp", |
| 20 "dependencies": { | 22 "dependencies": { |
| 21 "foo": {"path": path.join(sandboxDir, "foo")} | 23 "foo": {"path": path.join(sandboxDir, "foo")} |
| 22 } | 24 } |
| 23 }) | 25 }) |
| 24 ]).scheduleCreate(); | 26 ]).scheduleCreate(); |
| 25 | 27 |
| 26 schedulePub(args: ["install"], | 28 schedulePub(args: ["install"], |
| 27 output: new RegExp(r"Dependencies installed!$")); | 29 output: new RegExp(r"Dependencies installed!$")); |
| 28 | 30 |
| 29 dir(packagesPath, [ | 31 dir("moved").scheduleCreate(); |
| 30 dir("foo", [ | |
| 31 file("foo.dart", 'main() => "foo";') | |
| 32 ]) | |
| 33 ]).scheduleValidate(); | |
| 34 | 32 |
| 35 // Move the packages directory and ensure the symlink still works. That | 33 // Move the app but not the package. Since the symlink is absolute, it |
| 36 // will validate that we actually created an absolute symlink. | 34 // should still be able to find it. |
| 37 dir("moved").scheduleCreate(); | 35 scheduleRename(appPath, path.join("moved", appPath)); |
| 38 scheduleRename(packagesPath, "moved/packages"); | |
| 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 |