Index: sdk/lib/_internal/pub_generated/test/transformer/cache_test.dart |
diff --git a/sdk/lib/_internal/pub/test/transformer/cache_test.dart b/sdk/lib/_internal/pub_generated/test/transformer/cache_test.dart |
similarity index 55% |
copy from sdk/lib/_internal/pub/test/transformer/cache_test.dart |
copy to sdk/lib/_internal/pub_generated/test/transformer/cache_test.dart |
index d4a51a0fae36711d9f29a37b8011f8a9d8c846e0..fada25db129cfbb7e4c0d3db5de36d19ef316530 100644 |
--- a/sdk/lib/_internal/pub/test/transformer/cache_test.dart |
+++ b/sdk/lib/_internal/pub_generated/test/transformer/cache_test.dart |
@@ -39,27 +39,26 @@ void setUp() { |
servePackages((builder) { |
builder.serveRepoPackage('barback'); |
- builder.serve("foo", "1.2.3", |
- deps: {'barback': 'any'}, |
+ builder.serve("foo", "1.2.3", deps: { |
+ 'barback': 'any' |
+ }, |
contents: [ |
- d.dir("lib", [ |
- d.file("transformer.dart", replaceTransformer("Hello", "Goodbye")) |
- ]) |
- ]); |
+ d.dir( |
+ "lib", |
+ [d.file("transformer.dart", replaceTransformer("Hello", "Goodbye"))])]); |
- builder.serve("bar", "1.2.3", |
- deps: {'barback': 'any'}, |
+ builder.serve("bar", "1.2.3", deps: { |
+ 'barback': 'any' |
+ }, |
contents: [ |
- d.dir("lib", [ |
- d.file("transformer.dart", replaceTransformer("Goodbye", "See ya")) |
- ]) |
- ]); |
+ d.dir( |
+ "lib", |
+ [d.file("transformer.dart", replaceTransformer("Goodbye", "See ya"))])]); |
builder.serve("baz", "1.2.3"); |
}); |
- d.dir(appPath, [ |
- d.pubspec({ |
+ d.dir(appPath, [d.pubspec({ |
"name": "myapp", |
"dependencies": { |
"foo": "1.2.3", |
@@ -67,10 +66,7 @@ void setUp() { |
}, |
"transformers": ["foo"] |
}), |
- d.dir("bin", [ |
- d.file("myapp.dart", "main() => print('Hello!');") |
- ]) |
- ]).create(); |
+ d.dir("bin", [d.file("myapp.dart", "main() => print('Hello!');")])]).create(); |
pubGet(); |
} |
@@ -85,12 +81,14 @@ main() { |
process.stdout.expect("Goodbye!"); |
process.shouldExit(); |
- d.dir(appPath, [ |
- d.dir(".pub/transformers", [ |
- d.file("manifest.txt", "0.1.2+3\nfoo"), |
- d.matcherFile("transformers.snapshot", isNot(isEmpty)) |
- ]) |
- ]).validate(); |
+ d.dir( |
+ appPath, |
+ [ |
+ d.dir( |
+ ".pub/transformers", |
+ [ |
+ d.file("manifest.txt", "0.1.2+3\nfoo"), |
+ d.matcherFile("transformers.snapshot", isNot(isEmpty))])]).validate(); |
// Run the executable again to make sure loading the transformer from the |
// cache works. |
@@ -102,24 +100,27 @@ main() { |
integration("recaches if the SDK version is out-of-date", () { |
setUp(); |
- d.dir(appPath, [ |
- d.dir(".pub/transformers", [ |
- // The version 0.0.1 is different than the test version 0.1.2+3. |
+ d.dir( |
+ appPath, |
+ [ |
+ d.dir( |
+ ".pub/transformers", |
+ [// The version 0.0.1 is different than the test version 0.1.2+3. |
d.file("manifest.txt", "0.0.1\nfoo"), |
- d.file("transformers.snapshot", "junk") |
- ]) |
- ]).create(); |
+ d.file("transformers.snapshot", "junk")])]).create(); |
var process = pubRun(args: ['myapp']); |
process.stdout.expect("Goodbye!"); |
process.shouldExit(); |
- d.dir(appPath, [ |
- d.dir(".pub/transformers", [ |
- d.file("manifest.txt", "0.1.2+3\nfoo"), |
- d.matcherFile("transformers.snapshot", isNot(isEmpty)) |
- ]) |
- ]).validate(); |
+ d.dir( |
+ appPath, |
+ [ |
+ d.dir( |
+ ".pub/transformers", |
+ [ |
+ d.file("manifest.txt", "0.1.2+3\nfoo"), |
+ d.matcherFile("transformers.snapshot", isNot(isEmpty))])]).validate(); |
}); |
integration("recaches if the transformers change", () { |
@@ -129,15 +130,16 @@ main() { |
process.stdout.expect("Goodbye!"); |
process.shouldExit(); |
- d.dir(appPath, [ |
- d.dir(".pub/transformers", [ |
- d.file("manifest.txt", "0.1.2+3\nfoo"), |
- d.matcherFile("transformers.snapshot", isNot(isEmpty)) |
- ]) |
- ]).validate(); |
+ d.dir( |
+ appPath, |
+ [ |
+ d.dir( |
+ ".pub/transformers", |
+ [ |
+ d.file("manifest.txt", "0.1.2+3\nfoo"), |
+ d.matcherFile("transformers.snapshot", isNot(isEmpty))])]).validate(); |
- d.dir(appPath, [ |
- d.pubspec({ |
+ d.dir(appPath, [d.pubspec({ |
"name": "myapp", |
"dependencies": { |
"foo": "1.2.3", |
@@ -145,21 +147,20 @@ main() { |
}, |
"transformers": ["foo", "bar"] |
}), |
- d.dir("bin", [ |
- d.file("myapp.dart", "main() => print('Hello!');") |
- ]) |
- ]).create(); |
+ d.dir("bin", [d.file("myapp.dart", "main() => print('Hello!');")])]).create(); |
process = pubRun(args: ['myapp']); |
process.stdout.expect("See ya!"); |
process.shouldExit(); |
- d.dir(appPath, [ |
- d.dir(".pub/transformers", [ |
- d.file("manifest.txt", "0.1.2+3\nbar,foo"), |
- d.matcherFile("transformers.snapshot", isNot(isEmpty)) |
- ]) |
- ]).validate(); |
+ d.dir( |
+ appPath, |
+ [ |
+ d.dir( |
+ ".pub/transformers", |
+ [ |
+ d.file("manifest.txt", "0.1.2+3\nbar,foo"), |
+ d.matcherFile("transformers.snapshot", isNot(isEmpty))])]).validate(); |
}); |
integration("recaches if the transformer version changes", () { |
@@ -169,30 +170,32 @@ main() { |
process.stdout.expect("Goodbye!"); |
process.shouldExit(); |
- d.dir(appPath, [ |
- d.dir(".pub/transformers", [ |
- d.file("manifest.txt", "0.1.2+3\nfoo"), |
- d.matcherFile("transformers.snapshot", isNot(isEmpty)) |
- ]) |
- ]).validate(); |
+ d.dir( |
+ appPath, |
+ [ |
+ d.dir( |
+ ".pub/transformers", |
+ [ |
+ d.file("manifest.txt", "0.1.2+3\nfoo"), |
+ d.matcherFile("transformers.snapshot", isNot(isEmpty))])]).validate(); |
servePackages((builder) { |
- builder.serve("foo", "2.0.0", |
- deps: {'barback': 'any'}, |
+ builder.serve("foo", "2.0.0", deps: { |
+ 'barback': 'any' |
+ }, |
contents: [ |
- d.dir("lib", [ |
- d.file("transformer.dart", replaceTransformer("Hello", "New")) |
- ]) |
- ]); |
+ d.dir( |
+ "lib", |
+ [d.file("transformer.dart", replaceTransformer("Hello", "New"))])]); |
}); |
- d.dir(appPath, [ |
- d.pubspec({ |
+ d.dir(appPath, [d.pubspec({ |
"name": "myapp", |
- "dependencies": {"foo": "any"}, |
+ "dependencies": { |
+ "foo": "any" |
+ }, |
"transformers": ["foo"] |
- }) |
- ]).create(); |
+ })]).create(); |
pubUpgrade(); |
@@ -200,46 +203,42 @@ main() { |
process.stdout.expect("New!"); |
process.shouldExit(); |
- d.dir(appPath, [ |
- d.dir(".pub/transformers", [ |
- d.file("manifest.txt", "0.1.2+3\nfoo"), |
- d.matcherFile("transformers.snapshot", isNot(isEmpty)) |
- ]) |
- ]).validate(); |
+ d.dir( |
+ appPath, |
+ [ |
+ d.dir( |
+ ".pub/transformers", |
+ [ |
+ d.file("manifest.txt", "0.1.2+3\nfoo"), |
+ d.matcherFile("transformers.snapshot", isNot(isEmpty))])]).validate(); |
}); |
integration("recaches if a transitive dependency version changes", () { |
servePackages((builder) { |
builder.serveRepoPackage('barback'); |
- builder.serve("foo", "1.2.3", |
- deps: { |
- 'barback': 'any', |
- 'bar': 'any' |
- }, |
+ builder.serve("foo", "1.2.3", deps: { |
+ 'barback': 'any', |
+ 'bar': 'any' |
+ }, |
+ contents: [ |
+ d.dir("lib", [d.file("transformer.dart", REPLACE_FROM_LIBRARY_TRANSFORMER)])]); |
+ |
+ builder.serve( |
+ "bar", |
+ "1.2.3", |
contents: [ |
- d.dir("lib", [ |
- d.file("transformer.dart", REPLACE_FROM_LIBRARY_TRANSFORMER) |
- ]) |
- ]); |
- |
- builder.serve("bar", "1.2.3", contents: [ |
- d.dir("lib", [ |
- d.file("bar.dart", "final replacement = 'Goodbye';") |
- ]) |
- ]); |
+ d.dir("lib", [d.file("bar.dart", "final replacement = 'Goodbye';")])]); |
}); |
- d.dir(appPath, [ |
- d.pubspec({ |
+ d.dir(appPath, [d.pubspec({ |
"name": "myapp", |
- "dependencies": {"foo": "1.2.3"}, |
+ "dependencies": { |
+ "foo": "1.2.3" |
+ }, |
"transformers": ["foo"] |
}), |
- d.dir("bin", [ |
- d.file("myapp.dart", "main() => print('Hello!');") |
- ]) |
- ]).create(); |
+ d.dir("bin", [d.file("myapp.dart", "main() => print('Hello!');")])]).create(); |
pubGet(); |
@@ -248,20 +247,20 @@ main() { |
process.shouldExit(); |
servePackages((builder) { |
- builder.serve("bar", "2.0.0", contents: [ |
- d.dir("lib", [ |
- d.file("bar.dart", "final replacement = 'See ya';") |
- ]) |
- ]); |
+ builder.serve( |
+ "bar", |
+ "2.0.0", |
+ contents: [ |
+ d.dir("lib", [d.file("bar.dart", "final replacement = 'See ya';")])]); |
}); |
- d.dir(appPath, [ |
- d.pubspec({ |
+ d.dir(appPath, [d.pubspec({ |
"name": "myapp", |
- "dependencies": {"foo": "any"}, |
+ "dependencies": { |
+ "foo": "any" |
+ }, |
"transformers": ["foo"] |
- }) |
- ]).create(); |
+ })]).create(); |
pubUpgrade(); |
@@ -274,8 +273,7 @@ main() { |
integration("doesn't recache when a transformer is removed", () { |
setUp(); |
- d.dir(appPath, [ |
- d.pubspec({ |
+ d.dir(appPath, [d.pubspec({ |
"name": "myapp", |
"dependencies": { |
"foo": "1.2.3", |
@@ -283,17 +281,13 @@ main() { |
}, |
"transformers": ["foo", "bar"] |
}), |
- d.dir("bin", [ |
- d.file("myapp.dart", "main() => print('Hello!');") |
- ]) |
- ]).create(); |
+ d.dir("bin", [d.file("myapp.dart", "main() => print('Hello!');")])]).create(); |
var process = pubRun(args: ['myapp']); |
process.stdout.expect("See ya!"); |
process.shouldExit(); |
- d.dir(appPath, [ |
- d.pubspec({ |
+ d.dir(appPath, [d.pubspec({ |
"name": "myapp", |
"dependencies": { |
"foo": "1.2.3", |
@@ -303,10 +297,7 @@ main() { |
}, |
"transformers": ["foo"] |
}), |
- d.dir("bin", [ |
- d.file("myapp.dart", "main() => print('Hello!');") |
- ]) |
- ]).create(); |
+ d.dir("bin", [d.file("myapp.dart", "main() => print('Hello!');")])]).create(); |
process = pubRun(args: ['myapp']); |
process.stdout.expect( |
@@ -316,12 +307,14 @@ main() { |
// "bar" should still be in the manifest, since there's no reason to |
// recompile the cache. |
- d.dir(appPath, [ |
- d.dir(".pub/transformers", [ |
- d.file("manifest.txt", "0.1.2+3\nbar,foo"), |
- d.matcherFile("transformers.snapshot", isNot(isEmpty)) |
- ]) |
- ]).validate(); |
+ d.dir( |
+ appPath, |
+ [ |
+ d.dir( |
+ ".pub/transformers", |
+ [ |
+ d.file("manifest.txt", "0.1.2+3\nbar,foo"), |
+ d.matcherFile("transformers.snapshot", isNot(isEmpty))])]).validate(); |
}); |
} |