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

Unified Diff: sdk/lib/_internal/pub_generated/test/transformers_needed_by_transformers/no_dependencies_test.dart

Issue 557563002: Store the async-await compiled pub code directly in the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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_generated/test/transformers_needed_by_transformers/no_dependencies_test.dart
diff --git a/sdk/lib/_internal/pub_generated/test/transformers_needed_by_transformers/no_dependencies_test.dart b/sdk/lib/_internal/pub_generated/test/transformers_needed_by_transformers/no_dependencies_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f34cf3e4e940fb54d6c1ef22535d75941f2da09b
--- /dev/null
+++ b/sdk/lib/_internal/pub_generated/test/transformers_needed_by_transformers/no_dependencies_test.dart
@@ -0,0 +1,178 @@
+library pub_tests;
+import 'package:scheduled_test/scheduled_test.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+void main() {
+ initConfig();
+ integration("reports no dependencies if no transformers are used", () {
+ d.dir(appPath, [d.pubspec({
+ "name": "myapp",
+ "dependencies": {
+ "foo": {
+ "path": "../foo"
+ }
+ }
+ })]).create();
+ d.dir("foo", [d.libPubspec("foo", "1.0.0")]).create();
+ expectDependencies({});
+ });
+ integration(
+ "reports no dependencies if a transformer is used in a "
+ "package that doesn't expose a transformer",
+ () {
+ d.dir(appPath, [d.pubspec({
+ "name": "myapp",
+ "dependencies": {
+ "foo": {
+ "path": "../foo"
+ }
+ },
+ "transformers": ["foo"]
+ })]).create();
+ d.dir(
+ "foo",
+ [
+ d.libPubspec("foo", "1.0.0"),
+ d.dir("lib", [d.file("foo.dart", transformer())])]).create();
+ expectDependencies({
+ "foo": []
+ });
+ });
+ integration("reports no dependencies for non-file/package imports", () {
+ d.dir(appPath, [d.pubspec({
+ "name": "myapp",
+ "dependencies": {
+ "foo": {
+ "path": "../foo"
+ }
+ },
+ "transformers": ["myapp"]
+ }),
+ d.dir(
+ "lib",
+ [
+ d.file(
+ "myapp.dart",
+ transformer(
+ ["dart:async", "http://dartlang.org/nonexistent.dart"]))])]).create();
+ d.dir(
+ "foo",
+ [
+ d.libPubspec("foo", "1.0.0"),
+ d.dir("lib", [d.file("foo.dart", transformer())])]).create();
+ expectDependencies({
+ "myapp": []
+ });
+ });
+ integration("reports no dependencies for a single self transformer", () {
+ d.dir(appPath, [d.pubspec({
+ "name": "myapp",
+ "transformers": ["myapp"]
+ }), d.dir("lib", [d.file("myapp.dart", transformer())])]).create();
+ expectDependencies({
+ "myapp": []
+ });
+ });
+ integration(
+ "reports no dependencies if a transformer applies to files that "
+ "aren't used by the exposed transformer",
+ () {
+ d.dir(appPath, [d.pubspec({
+ "name": "myapp",
+ "dependencies": {
+ "foo": {
+ "path": "../foo"
+ }
+ },
+ "transformers": [{
+ "foo": {
+ "\$include": "lib/myapp.dart"
+ }
+ }, {
+ "foo": {
+ "\$exclude": "lib/transformer.dart"
+ }
+ }, "myapp"]
+ }),
+ d.dir(
+ "lib",
+ [
+ d.file("myapp.dart", ""),
+ d.file("transformer.dart", transformer())])]).create();
+ d.dir(
+ "foo",
+ [
+ d.libPubspec("foo", "1.0.0"),
+ d.dir("lib", [d.file("foo.dart", transformer())])]).create();
+ expectDependencies({
+ "myapp": [],
+ "foo": []
+ });
+ });
+ integration(
+ "reports no dependencies if a transformer applies to a "
+ "dependency's files that aren't used by the exposed transformer",
+ () {
+ d.dir(appPath, [d.pubspec({
+ "name": "myapp",
+ "dependencies": {
+ "foo": {
+ "path": "../foo"
+ }
+ },
+ "transformers": ["myapp"]
+ }),
+ d.dir(
+ "lib",
+ [
+ d.file("myapp.dart", ""),
+ d.file("transformer.dart", transformer(["package:foo/foo.dart"]))])]).create();
+ d.dir("foo", [d.pubspec({
+ "name": "foo",
+ "version": "1.0.0",
+ "transformers": [{
+ "foo": {
+ "\$exclude": "lib/foo.dart"
+ }
+ }]
+ }),
+ d.dir(
+ "lib",
+ [d.file("foo.dart", ""), d.file("transformer.dart", transformer())])]).create();
+ expectDependencies({
+ 'myapp': [],
+ 'foo': []
+ });
+ });
+ test("reports no dependencies on transformers in future phases", () {
+ d.dir(appPath, [d.pubspec({
+ "name": "myapp",
+ "transformers": [{
+ "myapp/first": {
+ "\$include": "lib/myapp.dart"
+ }
+ }, {
+ "myapp/second": {
+ "\$include": "lib/first.dart"
+ }
+ }, {
+ "myapp/third": {
+ "\$include": "lib/second.dart"
+ }
+ }]
+ }),
+ d.dir(
+ "lib",
+ [
+ d.file("myapp.dart", ""),
+ d.file("first.dart", transformer()),
+ d.file("second.dart", transformer()),
+ d.file("third.dart", transformer())])]).create();
+ expectDependencies({
+ 'myapp/first': [],
+ 'myapp/second': [],
+ 'myapp/third': []
+ });
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698