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

Unified Diff: pkg/barback/test/transformer_test.dart

Issue 223553008: Only pass an AssetId to isPrimary and declareOutputs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix script_compactor 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/test/transformer/rewrite.dart ('k') | pkg/code_transformers/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/test/transformer_test.dart
diff --git a/pkg/barback/test/transformer_test.dart b/pkg/barback/test/transformer_test.dart
index 902e140918511d0259742cb8b8fb1bfc73ee88ae..3eb83a16dab0b9e2fd97d1b64e10494dfd3352e0 100644
--- a/pkg/barback/test/transformer_test.dart
+++ b/pkg/barback/test/transformer_test.dart
@@ -17,23 +17,25 @@ main() {
group("isPrimary", () {
test("defaults to allowedExtensions", () {
var transformer = new ExtensionTransformer(".txt .bin");
- expect(transformer.isPrimary(makeAsset("foo.txt")),
+ expect(transformer.isPrimary(new AssetId("pkg", "foo.txt")),
completion(isTrue));
- expect(transformer.isPrimary(makeAsset("foo.bin")),
+ expect(transformer.isPrimary(new AssetId("pkg", "foo.bin")),
completion(isTrue));
- expect(transformer.isPrimary(makeAsset("foo.nottxt")),
+ expect(transformer.isPrimary(new AssetId("pkg", "foo.nottxt")),
completion(isFalse));
});
test("supports multi-level extensions with allowedExtensions", () {
var transformer = new ExtensionTransformer(".dart.js");
- expect(transformer.isPrimary(makeAsset("foo.dart.js")),
+ expect(transformer.isPrimary(new AssetId("pkg", "foo.dart.js")),
completion(isTrue));
- expect(transformer.isPrimary(makeAsset("foo.js")), completion(isFalse));
- expect(transformer.isPrimary(makeAsset("foo.dart")), completion(isFalse));
+ expect(transformer.isPrimary(new AssetId("pkg", "foo.js")),
+ completion(isFalse));
+ expect(transformer.isPrimary(new AssetId("pkg", "foo.dart")),
+ completion(isFalse));
});
test("throws an error for extensions without periods", () {
@@ -42,21 +44,18 @@ main() {
test("allows all files if allowedExtensions is not overridden", () {
var transformer = new MockTransformer();
- expect(transformer.isPrimary(makeAsset("foo.txt")),
+ expect(transformer.isPrimary(new AssetId("pkg", "foo.txt")),
completion(isTrue));
- expect(transformer.isPrimary(makeAsset("foo.bin")),
+ expect(transformer.isPrimary(new AssetId("pkg", "foo.bin")),
completion(isTrue));
- expect(transformer.isPrimary(makeAsset("anything")),
+ expect(transformer.isPrimary(new AssetId("pkg", "anything")),
completion(isTrue));
});
});
}
-Asset makeAsset(String path) =>
- new Asset.fromString(new AssetId.parse("app|$path"), "");
-
class MockTransformer extends Transformer {
MockTransformer();
« no previous file with comments | « pkg/barback/test/transformer/rewrite.dart ('k') | pkg/code_transformers/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698