| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // This library contains tests for transformer behavior that relates to actions | 5 // This library contains tests for transformer behavior that relates to actions |
| 6 // happening concurrently or other complex asynchronous timing behavior. | 6 // happening concurrently or other complex asynchronous timing behavior. |
| 7 library barback.test.package_graph.transform.transform_test; | 7 library barback.test.package_graph.transform.transform_test; |
| 8 | 8 |
| 9 import 'package:barback/src/utils.dart'; | 9 import 'package:barback/src/utils.dart'; |
| 10 import 'package:scheduled_test/scheduled_test.dart'; | 10 import 'package:scheduled_test/scheduled_test.dart'; |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 expectAsset('app|foo.out', 'spread txt.out'); | 335 expectAsset('app|foo.out', 'spread txt.out'); |
| 336 buildShouldSucceed(); | 336 buildShouldSucceed(); |
| 337 | 337 |
| 338 modifyAsset("app|foo.txt", "bar.mid"); | 338 modifyAsset("app|foo.txt", "bar.mid"); |
| 339 updateSources(["app|foo.txt"]); | 339 updateSources(["app|foo.txt"]); |
| 340 expectNoAsset('app|foo.out'); | 340 expectNoAsset('app|foo.out'); |
| 341 expectAsset('app|bar.out', 'spread txt.out'); | 341 expectAsset('app|bar.out', 'spread txt.out'); |
| 342 buildShouldSucceed(); | 342 buildShouldSucceed(); |
| 343 }); | 343 }); |
| 344 | 344 |
| 345 test("gets an asset transformed by a sync transformer", () { |
| 346 initGraph(["app|foo.blub"], {"app": [ |
| 347 [new SyncRewriteTransformer("blub", "blab")] |
| 348 ]}); |
| 349 updateSources(["app|foo.blub"]); |
| 350 expectAsset("app|foo.blab", "new.blab"); |
| 351 buildShouldSucceed(); |
| 352 }); |
| 353 |
| 345 group("Transform.hasInput", () { | 354 group("Transform.hasInput", () { |
| 346 test("returns whether an input exists", () { | 355 test("returns whether an input exists", () { |
| 347 initGraph(["app|foo.txt", "app|bar.txt"], {'app': [ | 356 initGraph(["app|foo.txt", "app|bar.txt"], {'app': [ |
| 348 [new HasInputTransformer(['app|foo.txt', 'app|bar.txt', 'app|baz.txt'])] | 357 [new HasInputTransformer(['app|foo.txt', 'app|bar.txt', 'app|baz.txt'])] |
| 349 ]}); | 358 ]}); |
| 350 | 359 |
| 351 updateSources(['app|foo.txt', 'app|bar.txt']); | 360 updateSources(['app|foo.txt', 'app|bar.txt']); |
| 352 expectAsset('app|foo.txt', | 361 expectAsset('app|foo.txt', |
| 353 'app|foo.txt: true, app|bar.txt: true, app|baz.txt: false'); | 362 'app|foo.txt: true, app|bar.txt: true, app|baz.txt: false'); |
| 354 buildShouldSucceed(); | 363 buildShouldSucceed(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 376 updateSources(['app|foo.txt']); | 385 updateSources(['app|foo.txt']); |
| 377 expectAsset('app|foo.txt', 'app|bar.txt: false'); | 386 expectAsset('app|foo.txt', 'app|bar.txt: false'); |
| 378 buildShouldSucceed(); | 387 buildShouldSucceed(); |
| 379 | 388 |
| 380 updateSources(['app|bar.txt']); | 389 updateSources(['app|bar.txt']); |
| 381 expectAsset('app|foo.txt', 'app|bar.txt: true'); | 390 expectAsset('app|foo.txt', 'app|bar.txt: true'); |
| 382 buildShouldSucceed(); | 391 buildShouldSucceed(); |
| 383 }); | 392 }); |
| 384 }); | 393 }); |
| 385 } | 394 } |
| OLD | NEW |