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

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

Issue 23199004: Support passing barback assets through phases in which they're unused. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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
Index: pkg/barback/test/package_graph/errors_test.dart
diff --git a/pkg/barback/test/package_graph/errors_test.dart b/pkg/barback/test/package_graph/errors_test.dart
index 46ff28996590ebfd379cbb39928f403685f4b96b..8e4fd891bfaa213b3c0c05e07b5118127058bfd5 100644
--- a/pkg/barback/test/package_graph/errors_test.dart
+++ b/pkg/barback/test/package_graph/errors_test.dart
@@ -284,4 +284,53 @@ main() {
expectAsset("app|foo.out", "two.out");
buildShouldFail([isAssetCollisionException("app|foo.out")]);
});
+
+ test("a collision with a pass-through asset returns the pass-through asset",
+ () {
+ initGraph([
+ "app|foo.txt",
+ "app|foo.in"
+ ], {"app": [
+ [new RewriteTransformer("in", "txt")]
+ ]});
+
+ updateSources(["app|foo.txt", "app|foo.in"]);
+ expectAsset("app|foo.txt", "foo");
+ buildShouldFail([isAssetCollisionException("app|foo.txt")]);
+ });
+
+ test("a new pass-through asset that collides returns the previous asset", () {
+ initGraph([
+ "app|foo.txt",
+ "app|foo.in"
+ ], {"app": [
+ [new RewriteTransformer("in", "txt")]
+ ]});
+
+ updateSources(["app|foo.in"]);
+ expectAsset("app|foo.txt", "foo.txt");
+ buildShouldSucceed();
+
+ updateSources(["app|foo.txt"]);
+ expectAsset("app|foo.txt", "foo.txt");
+ buildShouldFail([isAssetCollisionException("app|foo.txt")]);
+ });
+
+ test("a new transform output that collides with a pass-through asset returns "
+ "the pass-through asset", () {
+ initGraph([
+ "app|foo.txt",
+ "app|foo.in"
+ ], {"app": [
+ [new RewriteTransformer("in", "txt")]
+ ]});
+
+ updateSources(["app|foo.txt"]);
+ expectAsset("app|foo.txt", "foo");
+ buildShouldSucceed();
+
+ updateSources(["app|foo.in"]);
+ expectAsset("app|foo.txt", "foo");
+ buildShouldFail([isAssetCollisionException("app|foo.txt")]);
+ });
}

Powered by Google App Engine
This is Rietveld 408576698