Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: pkg/barback/test/package_graph/get_all_assets_test.dart

Issue 180473003: Barback transforms now pass through the primary input by default. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code reivew Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 barback.test.barback_test; 5 library barback.test.barback_test;
6 6
7 import 'package:scheduled_test/scheduled_test.dart'; 7 import 'package:scheduled_test/scheduled_test.dart';
8 8
9 import '../utils.dart'; 9 import '../utils.dart';
10 10
11 main() { 11 main() {
12 initConfig(); 12 initConfig();
13 13
14 test("gets all source assets", () { 14 test("gets all source assets", () {
15 initGraph(["app|a.txt", "app|b.txt", "app|c.txt"]); 15 initGraph(["app|a.txt", "app|b.txt", "app|c.txt"]);
16 updateSources(["app|a.txt", "app|b.txt", "app|c.txt"]); 16 updateSources(["app|a.txt", "app|b.txt", "app|c.txt"]);
17 expectAllAssets(["app|a.txt", "app|b.txt", "app|c.txt"]); 17 expectAllAssets(["app|a.txt", "app|b.txt", "app|c.txt"]);
18 buildShouldSucceed(); 18 buildShouldSucceed();
19 }); 19 });
20 20
21 test("includes transformed outputs, but not consumed ones", () { 21 test("includes transformed outputs", () {
22 initGraph(["app|a.txt", "app|foo.blub"], {"app": [ 22 initGraph(["app|a.txt", "app|foo.blub"], {"app": [
23 [new RewriteTransformer("blub", "blab")] 23 [new RewriteTransformer("blub", "blab")]
24 ]}); 24 ]});
25 updateSources(["app|a.txt", "app|foo.blub"]); 25 updateSources(["app|a.txt", "app|foo.blub"]);
26 expectAllAssets(["app|a.txt", "app|foo.blab"]); 26 expectAllAssets(["app|a.txt", "app|foo.blub", "app|foo.blab"]);
27 buildShouldSucceed(); 27 buildShouldSucceed();
28 }); 28 });
29 29
30 test("includes non-primary inputs to transformers", () { 30 test("includes overwritten outputs", () {
31 var transformer = new ManyToOneTransformer("txt"); 31 initGraph(["app|a.txt", "app|foo.blub"], {"app": [
32 initGraph({ 32 [new RewriteTransformer("blub", "blub")]
33 "app|a.txt": "a.inc", 33 ]});
34 "app|a.inc": "a" 34 updateSources(["app|a.txt", "app|foo.blub"]);
35 }, {"app": [[transformer]]}); 35 expectAllAssets({
36 36 "app|a.txt": "a",
37 updateSources(["app|a.txt", "app|a.inc"]); 37 "app|foo.blub": "foo.blub"
38 expectAllAssets(["app|a.inc", "app|a.out"]); 38 });
39 buildShouldSucceed(); 39 buildShouldSucceed();
40 }); 40 });
41 41
42 test("completes to an error if two transformers output the same file", () { 42 test("completes to an error if two transformers output the same file", () {
43 initGraph(["app|foo.a"], {"app": [ 43 initGraph(["app|foo.a"], {"app": [
44 [ 44 [
45 new RewriteTransformer("a", "b"), 45 new RewriteTransformer("a", "b"),
46 new RewriteTransformer("a", "b") 46 new RewriteTransformer("a", "b")
47 ] 47 ]
48 ]}); 48 ]});
(...skipping 19 matching lines...) Expand all
68 ] 68 ]
69 ]}); 69 ]});
70 70
71 updateSources(["app|foo.txt"]); 71 updateSources(["app|foo.txt"]);
72 expectAllAssetsShouldFail(isAggregateException([ 72 expectAllAssetsShouldFail(isAggregateException([
73 isTransformerException(equals(BadTransformer.ERROR)), 73 isTransformerException(equals(BadTransformer.ERROR)),
74 isTransformerException(equals(BadTransformer.ERROR)) 74 isTransformerException(equals(BadTransformer.ERROR))
75 ])); 75 ]));
76 }); 76 });
77 } 77 }
OLDNEW
« no previous file with comments | « pkg/barback/test/package_graph/errors_test.dart ('k') | pkg/barback/test/package_graph/group_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698