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

Unified Diff: pkg/barback/test/package_graph/lazy_transformer_test.dart

Issue 238513002: Lazy transformers followed by non-lazy ones shouldn't always be forced. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « pkg/barback/lib/src/transform_node.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/test/package_graph/lazy_transformer_test.dart
diff --git a/pkg/barback/test/package_graph/lazy_transformer_test.dart b/pkg/barback/test/package_graph/lazy_transformer_test.dart
index 12113a679f491db8bb3552702e84ad2906d7de3f..72e45d6bdca9df3f2e8af4bb0265c720f62d92c7 100644
--- a/pkg/barback/test/package_graph/lazy_transformer_test.dart
+++ b/pkg/barback/test/package_graph/lazy_transformer_test.dart
@@ -136,6 +136,29 @@ main() {
buildShouldSucceed();
});
+ test("a lazy asset piped into a non-lazy transformer that doesn't use its "
+ "outputs isn't eagerly compiled", () {
+ var transformer = new LazyRewriteTransformer("blub", "blab");
+ initGraph(["app|foo.blub"], {"app": [
+ [transformer],
+ [new RewriteTransformer("txt", "out")]
+ ]});
+ updateSources(["app|foo.blub"]);
+ buildShouldSucceed();
+ expect(transformer.numRuns, completion(equals(0)));
+ });
+
+ test("a lazy asset piped into a non-lazy transformer that doesn't use its "
+ "outputs is compiled on-demand", () {
+ initGraph(["app|foo.blub"], {"app": [
+ [new LazyRewriteTransformer("blub", "blab")],
+ [new RewriteTransformer("txt", "out")]
+ ]});
+ updateSources(["app|foo.blub"]);
+ expectAsset("app|foo.blab", "foo.blab");
+ buildShouldSucceed();
+ });
+
test("a lazy transformer followed by a non-lazy transformer is re-run "
"eagerly", () {
var rewrite = new LazyRewriteTransformer("one", "two");
« no previous file with comments | « pkg/barback/lib/src/transform_node.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698