| 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.source_test; | 5 library barback.test.package_graph.source_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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 test("a transformer can catch an error loading a secondary input", () { | 170 test("a transformer can catch an error loading a secondary input", () { |
| 171 initGraph(["app|foo.txt"], {"app": [ | 171 initGraph(["app|foo.txt"], {"app": [ |
| 172 [new CatchAssetNotFoundTransformer(".txt", "app|nothing")] | 172 [new CatchAssetNotFoundTransformer(".txt", "app|nothing")] |
| 173 ]}); | 173 ]}); |
| 174 | 174 |
| 175 updateSources(["app|foo.txt"]); | 175 updateSources(["app|foo.txt"]); |
| 176 expectAsset("app|foo.txt", "failed to load app|nothing"); | 176 expectAsset("app|foo.txt", "failed to load app|nothing"); |
| 177 buildShouldSucceed(); | 177 buildShouldSucceed(); |
| 178 }); | 178 }); |
| 179 |
| 180 test("a transformer that fails due to a missing secondary input is re-run " |
| 181 "when that input appears", () { |
| 182 initGraph({ |
| 183 "app|foo.txt": "bar.inc", |
| 184 "app|bar.inc": "bar" |
| 185 }, {"app": [ |
| 186 [new ManyToOneTransformer("txt")] |
| 187 ]}); |
| 188 |
| 189 updateSources(["app|foo.txt"]); |
| 190 expectNoAsset("app|foo.out"); |
| 191 buildShouldFail([isMissingInputException("app|bar.inc")]); |
| 192 |
| 193 updateSources(["app|bar.inc"]); |
| 194 expectAsset("app|foo.out", "bar"); |
| 195 buildShouldSucceed(); |
| 196 }); |
| 179 } | 197 } |
| OLD | NEW |