Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1136)

Unified Diff: test/package_graph/declaring_transformer_test.dart

Issue 1262483002: Fix a deadlock. (Closed) Base URL: git@github.com:dart-lang/barback@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/package_graph/declaring_transformer_test.dart
diff --git a/test/package_graph/declaring_transformer_test.dart b/test/package_graph/declaring_transformer_test.dart
index 88f2a83c033b677ce1a32f47791916601ddb2aee..aa830dfde0bd555064805def4d46a706d200003f 100644
--- a/test/package_graph/declaring_transformer_test.dart
+++ b/test/package_graph/declaring_transformer_test.dart
@@ -165,6 +165,35 @@ main() {
buildShouldSucceed();
});
+ // Regression test for #64.
+ test("a declaring transformer's output passes through a lazy transformer",
+ () {
+ var declaring = new DeclaringRewriteTransformer("one", "two");
+ initGraph(["app|foo.one"], {"app": [
+ [declaring],
+ [new LazyRewriteTransformer("two", "three")]
+ ]});
+
+ updateSources(["app|foo.one"]);
+ // Give the transformers time to declare their assets.
+ schedule(pumpEventQueue);
+
+ expectAsset("app|foo.one", "foo");
+ expectAsset("app|foo.two", "foo.two");
+ expectAsset("app|foo.three", "foo.two.three");
+ buildShouldSucceed();
+
+ modifyAsset("app|foo.one", "bar");
+ updateSources(["app|foo.one"]);
+
+ expectAsset("app|foo.one", "bar");
+ expectAsset("app|foo.two", "bar.two");
+ expectAsset("app|foo.three", "bar.two.three");
+ buildShouldSucceed();
+
+ expect(declaring.numRuns, completion(equals(2)));
+ });
+
test("a declaring transformer following a lazy transformer runs eagerly once "
"its input is available", () {
var declaring = new DeclaringRewriteTransformer("two", "three");
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698