| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 test("catches transformer exceptions and reports them", () { | 107 test("catches transformer exceptions and reports them", () { |
| 108 initGraph(["app|foo.txt"], {"app": [ | 108 initGraph(["app|foo.txt"], {"app": [ |
| 109 [new BadTransformer(["app|foo.out"])] | 109 [new BadTransformer(["app|foo.out"])] |
| 110 ]}); | 110 ]}); |
| 111 | 111 |
| 112 updateSources(["app|foo.txt"]); | 112 updateSources(["app|foo.txt"]); |
| 113 expectNoAsset("app|foo.out"); | 113 expectNoAsset("app|foo.out"); |
| 114 buildShouldFail([isTransformerException(equals(BadTransformer.ERROR))]); | 114 buildShouldFail([isTransformerException(equals(BadTransformer.ERROR))]); |
| 115 }); | 115 }); |
| 116 | 116 |
| 117 test("doesn't yield a source if a transform fails on it", () { |
| 118 initGraph(["app|foo.txt"], {"app": [ |
| 119 [new BadTransformer(["app|foo.txt"])] |
| 120 ]}); |
| 121 |
| 122 updateSources(["app|foo.txt"]); |
| 123 expectNoAsset("app|foo.txt"); |
| 124 }); |
| 125 |
| 117 test("catches errors even if nothing is waiting for process results", () { | 126 test("catches errors even if nothing is waiting for process results", () { |
| 118 initGraph(["app|foo.txt"], {"app": [[new BadTransformer([])]]}); | 127 initGraph(["app|foo.txt"], {"app": [[new BadTransformer([])]]}); |
| 119 | 128 |
| 120 updateSources(["app|foo.txt"]); | 129 updateSources(["app|foo.txt"]); |
| 121 // Note: No asset requests here. | 130 // Note: No asset requests here. |
| 122 buildShouldFail([isTransformerException(equals(BadTransformer.ERROR))]); | 131 buildShouldFail([isTransformerException(equals(BadTransformer.ERROR))]); |
| 123 }); | 132 }); |
| 124 | 133 |
| 125 test("discards outputs from failed transforms", () { | 134 test("discards outputs from failed transforms", () { |
| 126 initGraph(["app|foo.txt"], {"app": [ | 135 initGraph(["app|foo.txt"], {"app": [ |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 | 324 |
| 316 updateSources(["app|foo.txt"]); | 325 updateSources(["app|foo.txt"]); |
| 317 expectAsset("app|foo.txt", "foo"); | 326 expectAsset("app|foo.txt", "foo"); |
| 318 buildShouldSucceed(); | 327 buildShouldSucceed(); |
| 319 | 328 |
| 320 updateSources(["app|foo.in"]); | 329 updateSources(["app|foo.in"]); |
| 321 expectAsset("app|foo.txt", "foo"); | 330 expectAsset("app|foo.txt", "foo"); |
| 322 buildShouldFail([isAssetCollisionException("app|foo.txt")]); | 331 buildShouldFail([isAssetCollisionException("app|foo.txt")]); |
| 323 }); | 332 }); |
| 324 } | 333 } |
| OLD | NEW |