Index: sdk/lib/_internal/pub/test/serve/detects_a_transformer_cycle.dart |
diff --git a/sdk/lib/_internal/pub/test/serve/runs_one_third_party_transformer_on_another_test.dart b/sdk/lib/_internal/pub/test/serve/detects_a_transformer_cycle.dart |
similarity index 50% |
copy from sdk/lib/_internal/pub/test/serve/runs_one_third_party_transformer_on_another_test.dart |
copy to sdk/lib/_internal/pub/test/serve/detects_a_transformer_cycle.dart |
index 96732e907b6a657145f7bad699b56dbdea01e380..1da308071637c3914901aebaf6785658effb2b56 100644 |
--- a/sdk/lib/_internal/pub/test/serve/runs_one_third_party_transformer_on_another_test.dart |
+++ b/sdk/lib/_internal/pub/test/serve/detects_a_transformer_cycle.dart |
@@ -4,51 +4,46 @@ |
library pub_tests; |
+import 'package:scheduled_test/scheduled_test.dart'; |
+ |
import '../descriptor.dart' as d; |
import '../test_pub.dart'; |
import 'utils.dart'; |
main() { |
initConfig(); |
- integration("runs one third-party transformer on another", () { |
+ integration("detects a transformer cycle", () { |
d.dir("foo", [ |
d.pubspec({ |
"name": "foo", |
- "version": "1.0.0" |
- }), |
- d.dir("lib", [ |
- d.file("transformer.dart", dartTransformer('foo')), |
- ]) |
- ]).create(); |
- |
- d.dir("bar", [ |
- d.pubspec({ |
- "name": "bar", |
"version": "1.0.0", |
- "transformers": ["foo/transformer"], |
- "dependencies": {"foo": {"path": "../foo"}} |
+ "transformers": ["myapp/transformer"], |
+ "dependencies": {'myapp': {'path': '../myapp'}} |
}), |
d.dir("lib", [ |
- d.file("transformer.dart", dartTransformer('bar')), |
+ d.file("transformer.dart", dartTransformer('foo')), |
]) |
]).create(); |
d.dir(appPath, [ |
d.pubspec({ |
"name": "myapp", |
- "transformers": ["bar/transformer"], |
- "dependencies": {'bar': {'path': '../bar'}} |
+ "transformers": ["foo/transformer"], |
+ "dependencies": {'foo': {'path': '../foo'}} |
}), |
- d.dir("web", [ |
- d.file("main.dart", 'const TOKEN = "main.dart";') |
+ d.dir("lib", [ |
+ d.file("transformer.dart", dartTransformer('myapp')), |
]) |
]).create(); |
- createLockFile('myapp', sandbox: ['foo', 'bar'], pkg: ['barback']); |
+ createLockFile('myapp', sandbox: ['foo'], pkg: ['barback']); |
- startPubServe(); |
- requestShouldSucceed("main.dart", |
- 'const TOKEN = "(main.dart, (bar, foo))";'); |
- endPubServe(); |
+ // Use port 0 to get an ephemeral port. |
+ var process = startPub(args: ["serve", "--port=0"]); |
+ process.shouldExit(1); |
+ expect(process.remainingStderr(), completion(equals( |
+ "Transformer cycle detected:\n" |
+ " foo is transformed by myapp/transformer\n" |
+ " myapp is transformed by foo/transformer"))); |
}); |
} |