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

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

Issue 29603004: Revise the barback transformer-finding logic slightly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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/prefers_transformer_to_library_name_test.dart
diff --git a/sdk/lib/_internal/pub/test/transformer/can_use_read_input_as_string_test.dart b/sdk/lib/_internal/pub/test/transformer/prefers_transformer_to_library_name_test.dart
similarity index 63%
copy from sdk/lib/_internal/pub/test/transformer/can_use_read_input_as_string_test.dart
copy to sdk/lib/_internal/pub/test/transformer/prefers_transformer_to_library_name_test.dart
index 0084d5c8105331a836391d2652ce764ef03551f3..1019a6e25cd6b4b6e7bf1d44925dca1a08b15415 100644
--- a/sdk/lib/_internal/pub/test/transformer/can_use_read_input_as_string_test.dart
+++ b/sdk/lib/_internal/pub/test/transformer/prefers_transformer_to_library_name_test.dart
@@ -8,7 +8,7 @@ import '../descriptor.dart' as d;
import '../test_pub.dart';
import '../serve/utils.dart';
-const TRANSFORMER = """
+const WRONG_TRANSFORMER = """
import 'dart:async';
import 'package:barback/barback.dart';
@@ -19,10 +19,9 @@ class RewriteTransformer extends Transformer {
String get allowedExtensions => '.txt';
Future apply(Transform transform) {
- return transform.readInputAsString(transform.primaryInput.id)
- .then((contents) {
- var id = transform.primaryInput.id.changeExtension(".out");
- transform.addOutput(new Asset.fromString(id, "\$contents.out"));
+ return transform.primaryInput.readAsString().then((contents) {
+ var id = transform.primaryInput.id.changeExtension(".wrong");
+ transform.addOutput(new Asset.fromString(id, "\$contents.wrong"));
});
}
}
@@ -30,15 +29,16 @@ class RewriteTransformer extends Transformer {
main() {
initConfig();
- integration("a transform can use readInputAsString", () {
+ integration("prefers transformer.dart to <package name>.dart", () {
d.dir(appPath, [
d.pubspec({
"name": "myapp",
- "transformers": ["myapp/src/transformer"]
+ "transformers": ["myapp"]
}),
- d.dir("lib", [d.dir("src", [
- d.file("transformer.dart", TRANSFORMER)
- ])]),
+ d.dir("lib", [
+ d.file("transformer.dart", REWRITE_TRANSFORMER),
+ d.file("myapp.dart", WRONG_TRANSFORMER)
+ ]),
d.dir("web", [
d.file("foo.txt", "foo")
])
@@ -48,6 +48,7 @@ main() {
startPubServe();
requestShouldSucceed("foo.out", "foo.out");
+ requestShould404("foo.wrong");
endPubServe();
});
}
« sdk/lib/_internal/pub/lib/src/barback.dart ('K') | « sdk/lib/_internal/pub/lib/src/pubspec.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698