| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 setAssetError("app|foo.txt"); | 140 setAssetError("app|foo.txt"); |
| 141 updateSources(["app|foo.txt"]); | 141 updateSources(["app|foo.txt"]); |
| 142 expectNoAsset("app|foo.txt"); | 142 expectNoAsset("app|foo.txt"); |
| 143 buildShouldFail([ | 143 buildShouldFail([ |
| 144 isAssetLoadException("app|foo.txt", isMockLoadException("app|foo.txt")) | 144 isAssetLoadException("app|foo.txt", isMockLoadException("app|foo.txt")) |
| 145 ]); | 145 ]); |
| 146 }); | 146 }); |
| 147 | 147 |
| 148 test("an asset isn't passed through a transformer with an error", () { | 148 test("an asset isn't passed through a transformer with an error", () { |
| 149 initGraph(["app|foo.txt",], {"app": [[new BadTransformer([])]]}); | 149 initGraph(["app|foo.txt"], {"app": [[new BadTransformer([])]]}); |
| 150 | 150 |
| 151 updateSources(["app|foo.txt"]); | 151 updateSources(["app|foo.txt"]); |
| 152 expectNoAsset("app|foo.txt"); | 152 expectNoAsset("app|foo.txt"); |
| 153 buildShouldFail([isTransformerException(equals(BadTransformer.ERROR))]); | 153 buildShouldFail([isTransformerException(equals(BadTransformer.ERROR))]); |
| 154 }); | 154 }); |
| 155 |
| 156 test("a transformer can catch an error loading a secondary input", () { |
| 157 initGraph(["app|foo.txt"], {"app": [ |
| 158 [new CatchAssetNotFoundTransformer(".txt", "app|nothing")] |
| 159 ]}); |
| 160 |
| 161 updateSources(["app|foo.txt"]); |
| 162 expectAsset("app|foo.txt", "failed to load app|nothing"); |
| 163 buildShouldSucceed(); |
| 164 }); |
| 155 } | 165 } |
| OLD | NEW |