| 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 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 void declareOutputs(DeclaringAggregateTransform transform) { | 37 void declareOutputs(DeclaringAggregateTransform transform) { |
| 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 integration("loads a lazy aggregate transformer", () { | 45 integration("loads a lazy aggregate transformer", () { |
| 46 serveBarback(); |
| 47 |
| 46 d.dir(appPath, [ | 48 d.dir(appPath, [ |
| 47 d.pubspec({ | 49 d.pubspec({ |
| 48 "name": "myapp", | 50 "name": "myapp", |
| 49 "transformers": ["myapp"] | 51 "transformers": ["myapp"], |
| 52 "dependencies": {"barback": "any"} |
| 50 }), | 53 }), |
| 51 d.dir("lib", [ | 54 d.dir("lib", [ |
| 52 d.file("transformer.dart", AGGREGATE_TRANSFORMER), | 55 d.file("transformer.dart", AGGREGATE_TRANSFORMER), |
| 53 ]), | 56 ]), |
| 54 d.dir("web", [ | 57 d.dir("web", [ |
| 55 d.file("foo.txt", "foo"), | 58 d.file("foo.txt", "foo"), |
| 56 d.file("bar.txt", "bar") | 59 d.file("bar.txt", "bar") |
| 57 ]) | 60 ]) |
| 58 ]).create(); | 61 ]).create(); |
| 59 | 62 |
| 60 createLockFile('myapp', pkg: ['barback']); | 63 pubGet(); |
| 61 | |
| 62 var server = pubServe(); | 64 var server = pubServe(); |
| 63 // The transformer should preserve laziness. | 65 // The transformer should preserve laziness. |
| 64 server.stdout.expect("Build completed successfully"); | 66 server.stdout.expect("Build completed successfully"); |
| 65 | 67 |
| 66 requestShouldSucceed("out.txt", "bar\nfoo"); | 68 requestShouldSucceed("out.txt", "bar\nfoo"); |
| 67 endPubServe(); | 69 endPubServe(); |
| 68 }); | 70 }); |
| 69 } | 71 } |
| OLD | NEW |