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 15 matching lines...) Expand all Loading... |
26 var id = transform.primaryInput.id.changeExtension(".out"); | 26 var id = transform.primaryInput.id.changeExtension(".out"); |
27 var asset = new Asset.fromString(id, | 27 var asset = new Asset.fromString(id, |
28 "primary: \${results[0]}, secondary: \${results[1]}"); | 28 "primary: \${results[0]}, secondary: \${results[1]}"); |
29 transform.addOutput(asset); | 29 transform.addOutput(asset); |
30 }); | 30 }); |
31 } | 31 } |
32 } | 32 } |
33 """; | 33 """; |
34 | 34 |
35 main() { | 35 main() { |
36 withBarbackVersions("any", () { | 36 integration("a transform can use hasInput", () { |
37 integration("a transform can use hasInput", () { | 37 d.dir(appPath, [ |
38 d.dir(appPath, [ | 38 d.pubspec({ |
39 d.pubspec({ | 39 "name": "myapp", |
40 "name": "myapp", | 40 "transformers": ["myapp/src/transformer"] |
41 "transformers": ["myapp/src/transformer"] | 41 }), |
42 }), | 42 d.dir("lib", [d.dir("src", [ |
43 d.dir("lib", [d.dir("src", [ | 43 d.file("transformer.dart", TRANSFORMER) |
44 d.file("transformer.dart", TRANSFORMER) | 44 ])]), |
45 ])]), | 45 d.dir("web", [ |
46 d.dir("web", [ | 46 d.file("foo.txt", "foo") |
47 d.file("foo.txt", "foo") | 47 ]) |
48 ]) | 48 ]).create(); |
49 ]).create(); | |
50 | 49 |
51 createLockFile('myapp', pkg: ['barback']); | 50 createLockFile('myapp', pkg: ['barback']); |
52 | 51 |
53 pubServe(); | 52 pubServe(); |
54 requestShouldSucceed("foo.out", "primary: true, secondary: false"); | 53 requestShouldSucceed("foo.out", "primary: true, secondary: false"); |
55 endPubServe(); | 54 endPubServe(); |
56 }); | 55 }); |
57 }); | |
58 } | 56 } |
OLD | NEW |