OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2014, 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 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 '../descriptor.dart' as d; | 7 import '../descriptor.dart' as d; |
8 import '../test_pub.dart'; | 8 import '../test_pub.dart'; |
9 import '../serve/utils.dart'; | 9 import '../serve/utils.dart'; |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 transform.declareOutput(new AssetId(transform.package, | 38 transform.declareOutput(new AssetId(transform.package, |
39 p.url.join(transform.key, 'out.txt'))); | 39 p.url.join(transform.key, 'out.txt'))); |
40 } | 40 } |
41 } | 41 } |
42 """; | 42 """; |
43 | 43 |
44 main() { | 44 main() { |
45 initConfig(); | 45 initConfig(); |
46 withBarbackVersions(">=0.14.1", () { | 46 withBarbackVersions(">=0.14.1", () { |
47 integration("loads a lazy aggregate transformer", () { | 47 integration("loads a lazy aggregate transformer", () { |
48 d.dir(appPath, [ | 48 d.dir(appPath, [d.pubspec({ |
49 d.pubspec({ | |
50 "name": "myapp", | 49 "name": "myapp", |
51 "transformers": ["myapp"] | 50 "transformers": ["myapp"] |
52 }), | 51 }), |
53 d.dir("lib", [ | 52 d.dir("lib", [d.file("transformer.dart", AGGREGATE_TRANSFORMER),]), |
54 d.file("transformer.dart", AGGREGATE_TRANSFORMER), | 53 d.dir("web", [d.file("foo.txt", "foo"), d.file("bar.txt", "bar")])])
.create(); |
55 ]), | |
56 d.dir("web", [ | |
57 d.file("foo.txt", "foo"), | |
58 d.file("bar.txt", "bar") | |
59 ]) | |
60 ]).create(); | |
61 | 54 |
62 createLockFile('myapp', pkg: ['barback']); | 55 createLockFile('myapp', pkg: ['barback']); |
63 | 56 |
64 var server = pubServe(); | 57 var server = pubServe(); |
65 // The transformer should preserve laziness. | 58 // The transformer should preserve laziness. |
66 server.stdout.expect("Build completed successfully"); | 59 server.stdout.expect("Build completed successfully"); |
67 | 60 |
68 requestShouldSucceed("out.txt", "bar\nfoo"); | 61 requestShouldSucceed("out.txt", "bar\nfoo"); |
69 endPubServe(); | 62 endPubServe(); |
70 }); | 63 }); |
71 }); | 64 }); |
72 } | 65 } |
OLD | NEW |