OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 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 | 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 library pub_tests; | 5 library pub_tests; |
6 | 6 |
7 import 'package:path/path.dart' as p; | 7 import 'package:path/path.dart' as p; |
8 import 'package:scheduled_test/scheduled_test.dart'; | 8 import 'package:scheduled_test/scheduled_test.dart'; |
9 | 9 |
10 import '../descriptor.dart' as d; | 10 import '../descriptor.dart' as d; |
(...skipping 12 matching lines...) Expand all Loading... |
23 """; | 23 """; |
24 | 24 |
25 main() { | 25 main() { |
26 initConfig(); | 26 initConfig(); |
27 | 27 |
28 // Regression test for issue 20917. | 28 // Regression test for issue 20917. |
29 integration("snapshots the transformed version of an executable", () { | 29 integration("snapshots the transformed version of an executable", () { |
30 servePackages((builder) { | 30 servePackages((builder) { |
31 builder.serveRepoPackage('barback'); | 31 builder.serveRepoPackage('barback'); |
32 | 32 |
33 builder.serve("foo", "1.2.3", | 33 builder.serve( |
| 34 "foo", |
| 35 "1.2.3", |
34 contents: [ | 36 contents: [ |
35 d.dir("bin", [ | 37 d.dir("bin", [d.file("hello.dart", "void main() => print('hello!')
;")])]); |
36 d.file("hello.dart", "void main() => print('hello!');") | |
37 ]) | |
38 ]); | |
39 }); | 38 }); |
40 | 39 |
41 d.dir(appPath, [ | 40 d.dir(appPath, [d.pubspec({ |
42 d.pubspec({ | |
43 "name": "myapp", | 41 "name": "myapp", |
44 "dependencies": { | 42 "dependencies": { |
45 "foo": "1.2.3", | 43 "foo": "1.2.3", |
46 "barback": "any" | 44 "barback": "any" |
47 }, | 45 }, |
48 "transformers": ["myapp"] | 46 "transformers": ["myapp"] |
49 }), | 47 }), |
50 d.dir("lib", [ | 48 d.dir("lib", [d.file("transformer.dart", BROKEN_TRANSFORMER)])]).creat
e(); |
51 d.file("transformer.dart", BROKEN_TRANSFORMER) | |
52 ]) | |
53 ]).create(); | |
54 | 49 |
55 pubGet(output: contains("Precompiled foo:hello.")); | 50 pubGet(output: contains("Precompiled foo:hello.")); |
56 | 51 |
57 d.dir(p.join(appPath, '.pub', 'bin'), [ | 52 d.dir( |
58 d.dir('foo', [d.matcherFile('hello.dart.snapshot', contains('hello!'))]) | 53 p.join(appPath, '.pub', 'bin'), |
59 ]).validate(); | 54 [ |
| 55 d.dir( |
| 56 'foo', |
| 57 [d.matcherFile('hello.dart.snapshot', contains('hello!'))])]).va
lidate(); |
60 | 58 |
61 var process = pubRun(args: ['foo:hello']); | 59 var process = pubRun(args: ['foo:hello']); |
62 process.stdout.expect("hello!"); | 60 process.stdout.expect("hello!"); |
63 process.shouldExit(); | 61 process.shouldExit(); |
64 }); | 62 }); |
65 } | 63 } |
OLD | NEW |