OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import 'dart:io'; |
| 6 |
| 7 import '../../../../../pkg/path/lib/path.dart' as path; |
| 8 |
| 9 import '../../../../pub/exit_codes.dart' as exit_codes; |
| 10 import '../../test_pub.dart'; |
| 11 |
| 12 main() { |
| 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 |
| 15 // support relative paths. So this test, by design, will not pass on Windows. |
| 16 // So just skip it. |
| 17 if (Platform.operatingSystem == "windows") return; |
| 18 |
| 19 initConfig(); |
| 20 integration("generates a symlink with a relative path if the dependency " |
| 21 "path was relative", () { |
| 22 dir("foo", [ |
| 23 libDir("foo"), |
| 24 libPubspec("foo", "0.0.1") |
| 25 ]).scheduleCreate(); |
| 26 |
| 27 dir(appPath, [ |
| 28 pubspec({ |
| 29 "name": "myapp", |
| 30 "dependencies": { |
| 31 "foo": {"path": "../foo"} |
| 32 } |
| 33 }) |
| 34 ]).scheduleCreate(); |
| 35 |
| 36 schedulePub(args: ["install"], |
| 37 output: new RegExp(r"Dependencies installed!$")); |
| 38 |
| 39 dir("moved").scheduleCreate(); |
| 40 |
| 41 // Move the app and package. Since they are still next to each other, it |
| 42 // should still be found. |
| 43 scheduleRename("foo", path.join("moved", "foo")); |
| 44 scheduleRename(appPath, path.join("moved", appPath)); |
| 45 |
| 46 dir("moved", [ |
| 47 dir(packagesPath, [ |
| 48 dir("foo", [ |
| 49 file("foo.dart", 'main() => "foo";') |
| 50 ]) |
| 51 ]) |
| 52 ]).scheduleValidate(); |
| 53 }); |
| 54 } |
OLD | NEW |