| OLD | NEW |
| 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.package_graph.transform_test; | 5 library barback.test.package_graph.transform_test; |
| 6 | 6 |
| 7 import 'package:barback/src/utils.dart'; | 7 import 'package:barback/src/utils.dart'; |
| 8 import 'package:scheduled_test/scheduled_test.dart'; | 8 import 'package:scheduled_test/scheduled_test.dart'; |
| 9 | 9 |
| 10 import '../utils.dart'; | 10 import '../utils.dart'; |
| (...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 updateSources(["pkg1|a.txt", "pkg2|a.txt"]); | 995 updateSources(["pkg1|a.txt", "pkg2|a.txt"]); |
| 996 expectAsset("pkg1|a.out", "a.inc"); | 996 expectAsset("pkg1|a.out", "a.inc"); |
| 997 buildShouldSucceed(); | 997 buildShouldSucceed(); |
| 998 | 998 |
| 999 modifyAsset("pkg2|a.txt", "new a"); | 999 modifyAsset("pkg2|a.txt", "new a"); |
| 1000 updateSources(["pkg2|a.txt"]); | 1000 updateSources(["pkg2|a.txt"]); |
| 1001 expectAsset("pkg1|a.out", "new a.inc"); | 1001 expectAsset("pkg1|a.out", "new a.inc"); |
| 1002 buildShouldSucceed(); | 1002 buildShouldSucceed(); |
| 1003 }); | 1003 }); |
| 1004 | 1004 |
| 1005 test("doesn't complete the build until all packages' transforms are " |
| 1006 "finished running", () { |
| 1007 var transformer = new ManyToOneTransformer("txt"); |
| 1008 initGraph({ |
| 1009 "pkg1|a.txt": "pkg2|a.inc", |
| 1010 "pkg2|a.inc": "a" |
| 1011 }, { |
| 1012 "pkg1": [[transformer]] |
| 1013 }); |
| 1014 |
| 1015 updateSources(["pkg1|a.txt", "pkg2|a.inc"]); |
| 1016 expectAsset("pkg1|a.out", "a"); |
| 1017 buildShouldSucceed(); |
| 1018 |
| 1019 transformer.pauseApply(); |
| 1020 modifyAsset("pkg2|a.inc", "new a"); |
| 1021 updateSources(["pkg2|a.inc"]); |
| 1022 buildShouldNotBeDone(); |
| 1023 |
| 1024 transformer.resumeApply(); |
| 1025 buildShouldSucceed(); |
| 1026 }); |
| 1027 |
| 1005 test("runs a transform that's added because of a change in another package", | 1028 test("runs a transform that's added because of a change in another package", |
| 1006 () { | 1029 () { |
| 1007 initGraph({ | 1030 initGraph({ |
| 1008 "pkg1|a.txt": "pkg2|a.inc", | 1031 "pkg1|a.txt": "pkg2|a.inc", |
| 1009 "pkg2|a.inc": "b" | 1032 "pkg2|a.inc": "b" |
| 1010 }, { | 1033 }, { |
| 1011 "pkg1": [ | 1034 "pkg1": [ |
| 1012 [new ManyToOneTransformer("txt")], | 1035 [new ManyToOneTransformer("txt")], |
| 1013 [new OneToManyTransformer("out")], | 1036 [new OneToManyTransformer("out")], |
| 1014 [new RewriteTransformer("md", "done")] | 1037 [new RewriteTransformer("md", "done")] |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 transformer1.resumeApply(); | 1146 transformer1.resumeApply(); |
| 1124 | 1147 |
| 1125 expectAsset("app|foo.out", "foo.mid.out"); | 1148 expectAsset("app|foo.out", "foo.mid.out"); |
| 1126 buildShouldSucceed(); | 1149 buildShouldSucceed(); |
| 1127 | 1150 |
| 1128 expect(transformer1.numRuns, completion(equals(2))); | 1151 expect(transformer1.numRuns, completion(equals(2))); |
| 1129 expect(transformer2.numRuns, completion(equals(2))); | 1152 expect(transformer2.numRuns, completion(equals(2))); |
| 1130 }); | 1153 }); |
| 1131 }); | 1154 }); |
| 1132 } | 1155 } |
| OLD | NEW |