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 library pub_tests; | |
6 | |
7 import 'package:path/path.dart' as p; | |
8 import 'package:scheduled_test/scheduled_test.dart'; | |
9 import 'package:scheduled_test/scheduled_stream.dart'; | |
10 | |
11 import '../descriptor.dart' as d; | |
12 import '../test_pub.dart'; | |
13 | |
14 main() { | |
15 initConfig(); | |
16 integration( | |
17 "creates a snapshot for an immediate dependency's executables", | |
18 () { | |
19 servePackages((builder) { | |
20 builder.serve( | |
21 "foo", | |
22 "5.6.7", | |
23 contents: [ | |
24 d.dir("bin", [d.file("hello.dart", "void main() => print('hello!')
;")])]); | |
25 }); | |
26 | |
27 d.appDir({ | |
28 "foo": "5.6.7" | |
29 }).create(); | |
30 | |
31 pubGet(output: contains("Precompiled foo:hello.")); | |
32 | |
33 d.dir( | |
34 p.join(appPath, '.pub', 'bin'), | |
35 [d.dir('foo', [d.outOfDateSnapshot('hello.dart.snapshot')])]).create(); | |
36 | |
37 var process = pubRun(args: ['foo:hello']); | |
38 | |
39 // In the real world this would just print "hello!", but since we collect | |
40 // all output we see the precompilation messages as well. | |
41 process.stdout.expect("Precompiling executables..."); | |
42 process.stdout.expect(consumeThrough("hello!")); | |
43 process.shouldExit(); | |
44 | |
45 d.dir( | |
46 p.join(appPath, '.pub', 'bin'), | |
47 [ | |
48 d.file('sdk-version', '0.1.2+3'), | |
49 d.dir( | |
50 'foo', | |
51 [d.matcherFile('hello.dart.snapshot', contains('hello!'))])]).cr
eate(); | |
52 }); | |
53 } | |
OLD | NEW |