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; |
| 6 import 'package:scheduled_test/scheduled_test.dart'; |
| 7 import 'package:unittest/unittest.dart'; |
| 8 |
| 9 import '../../../lib/src/lock_file.dart'; |
| 10 import '../../../lib/src/source_registry.dart'; |
5 import '../../descriptor.dart' as d; | 11 import '../../descriptor.dart' as d; |
6 import '../../test_pub.dart'; | 12 import '../../test_pub.dart'; |
7 | 13 |
8 main() { | 14 main() { |
9 initConfig(); | 15 initConfig(); |
10 integration("can use relative path", () { | 16 integration("can use relative path", () { |
11 d.dir("foo", [ | 17 d.dir("foo", [ |
12 d.libDir("foo"), | 18 d.libDir("foo"), |
13 d.libPubspec("foo", "0.0.1") | 19 d.libPubspec("foo", "0.0.1") |
14 ]).create(); | 20 ]).create(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 58 |
53 d.dir(packagesPath, [ | 59 d.dir(packagesPath, [ |
54 d.dir("foo", [ | 60 d.dir("foo", [ |
55 d.file("foo.dart", 'main() => "foo";') | 61 d.file("foo.dart", 'main() => "foo";') |
56 ]), | 62 ]), |
57 d.dir("bar", [ | 63 d.dir("bar", [ |
58 d.file("bar.dart", 'main() => "bar";') | 64 d.file("bar.dart", 'main() => "bar";') |
59 ]) | 65 ]) |
60 ]).validate(); | 66 ]).validate(); |
61 }); | 67 }); |
| 68 |
| 69 integration("relative path preserved in the lockfile", () { |
| 70 d.dir("foo", [ |
| 71 d.libDir("foo"), |
| 72 d.libPubspec("foo", "0.0.1") |
| 73 ]).create(); |
| 74 |
| 75 d.dir(appPath, [ |
| 76 d.appPubspec({ |
| 77 "foo": {"path": "../foo"} |
| 78 }) |
| 79 ]).create(); |
| 80 |
| 81 pubGet(); |
| 82 |
| 83 schedule(() { |
| 84 var lockfilePath = path.join(sandboxDir, appPath, "pubspec.lock"); |
| 85 var lockfile = new LockFile.load(lockfilePath, new SourceRegistry()); |
| 86 var description = lockfile.packages["foo"].description; |
| 87 |
| 88 expect(path.isRelative(description["path"]), isTrue); |
| 89 }); |
| 90 }); |
62 } | 91 } |
OLD | NEW |