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

Unified Diff: sdk/lib/_internal/pub/test/transformer/exclusion/works_on_lazy_transformer_test.dart

Issue 294123009: Make lazy and declaring transformers work with $include/$exclude. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: analyzer fixes Created 6 years, 7 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: sdk/lib/_internal/pub/test/transformer/exclusion/works_on_lazy_transformer_test.dart
diff --git a/sdk/lib/_internal/pub/test/transformer/exclusion/works_on_transformer_group_test.dart b/sdk/lib/_internal/pub/test/transformer/exclusion/works_on_lazy_transformer_test.dart
similarity index 52%
copy from sdk/lib/_internal/pub/test/transformer/exclusion/works_on_transformer_group_test.dart
copy to sdk/lib/_internal/pub/test/transformer/exclusion/works_on_lazy_transformer_test.dart
index d18fd56dd413b3cc9156e7539b19491a240a2a80..deef7a0360758a8c240bb1515439305bf29a4614 100644
--- a/sdk/lib/_internal/pub/test/transformer/exclusion/works_on_transformer_group_test.dart
+++ b/sdk/lib/_internal/pub/test/transformer/exclusion/works_on_lazy_transformer_test.dart
@@ -4,53 +4,49 @@
library pub_tests;
+import 'package:scheduled_test/scheduled_stream.dart';
+import 'package:scheduled_test/scheduled_test.dart';
+
import '../../descriptor.dart' as d;
import '../../test_pub.dart';
import '../../serve/utils.dart';
-const GROUP = """
-import 'package:barback/barback.dart';
-
-import 'transformer.dart';
-
-class RewriteGroup implements TransformerGroup {
- RewriteGroup.asPlugin();
-
- Iterable<Iterable> get phases => [[new RewriteTransformer.asPlugin()]];
-}
-""";
-
main() {
initConfig();
- integration("works on a transformer group", () {
+ integration("works on a lazy transformer", () {
d.dir(appPath, [
d.pubspec({
"name": "myapp",
"transformers": [
{
- "myapp/src/group": {
+ "myapp": {
"\$include": ["web/a.txt", "web/b.txt"],
"\$exclude": "web/a.txt"
}
}
]
}),
- d.dir("lib", [d.dir("src", [
- d.file("transformer.dart", REWRITE_TRANSFORMER),
- d.file("group.dart", GROUP)
- ])]),
+ d.dir("lib", [d.file("transformer.dart", LAZY_TRANSFORMER)]),
d.dir("web", [
- d.file("a.txt", "a.txt"),
- d.file("b.txt", "b.txt"),
- d.file("c.txt", "c.txt")
+ d.file("a.txt", "a"),
+ d.file("b.txt", "b"),
+ d.file("c.txt", "c")
])
]).create();
createLockFile('myapp', pkg: ['barback']);
- pubServe();
+ var server = pubServe();
+ // The transformer should remain lazy.
+ server.stdout.expect("Build completed successfully");
+
requestShould404("a.out");
- requestShouldSucceed("b.out", "b.txt.out");
+ requestShouldSucceed("b.out", isNot(isEmpty));
+ server.stdout.expect(consumeThrough(emitsLines(
+ "[Info from LazyRewrite]:\n"
+ "Rewriting myapp|web/b.txt.")));
+ server.stdout.expect(consumeThrough("Build completed successfully"));
+
requestShould404("c.out");
endPubServe();
});

Powered by Google App Engine
This is Rietveld 408576698