OLD | NEW |
| (Empty) |
1 // Copyright (c) 2014, 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 'package:scheduled_test/scheduled_test.dart'; | |
6 | |
7 import '../../descriptor.dart' as d; | |
8 import '../../test_pub.dart'; | |
9 | |
10 main() { | |
11 initConfig(); | |
12 integration('uses the 1.6-style lockfile if necessary', () { | |
13 servePackages((builder) { | |
14 builder.serve("bar", "1.0.0"); | |
15 builder.serve("foo", "1.0.0", deps: {"bar": "any"}, contents: [ | |
16 d.dir("bin", [ | |
17 d.file("script.dart", """ | |
18 import 'package:bar/bar.dart' as bar; | |
19 | |
20 main(args) => print(bar.main());""") | |
21 ]) | |
22 ]); | |
23 }); | |
24 | |
25 schedulePub(args: ["cache", "add", "foo"]); | |
26 schedulePub(args: ["cache", "add", "bar"]); | |
27 | |
28 d.dir(cachePath, [ | |
29 d.dir('global_packages', [ | |
30 d.file('foo.lock', ''' | |
31 packages: | |
32 foo: | |
33 description: foo | |
34 source: hosted | |
35 version: "1.0.0" | |
36 bar: | |
37 description: bar | |
38 source: hosted | |
39 version: "1.0.0"''') | |
40 ]) | |
41 ]).create(); | |
42 | |
43 var pub = pubRun(global: true, args: ["foo:script"]); | |
44 pub.stdout.expect("bar 1.0.0"); | |
45 pub.shouldExit(); | |
46 | |
47 d.dir(cachePath, [ | |
48 d.dir('global_packages', [ | |
49 d.nothing('foo.lock'), | |
50 d.dir('foo', [d.matcherFile('pubspec.lock', contains('1.0.0'))]) | |
51 ]) | |
52 ]).validate(); | |
53 }); | |
54 } | |
OLD | NEW |