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

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

Issue 198053009: Use real "package:" imports in pub's plugin-loading code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 9 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/can_use_has_input_test.dart
diff --git a/sdk/lib/_internal/pub/test/transformer/can_use_read_input_test.dart b/sdk/lib/_internal/pub/test/transformer/can_use_has_input_test.dart
similarity index 69%
copy from sdk/lib/_internal/pub/test/transformer/can_use_read_input_test.dart
copy to sdk/lib/_internal/pub/test/transformer/can_use_has_input_test.dart
index fba1eed718ec25ea170930a19ddaa6b9f38e3393..543bf01f833e52d526d3e1356da90c82a576b9c2 100644
--- a/sdk/lib/_internal/pub/test/transformer/can_use_read_input_test.dart
+++ b/sdk/lib/_internal/pub/test/transformer/can_use_has_input_test.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -19,10 +19,13 @@ class RewriteTransformer extends Transformer {
String get allowedExtensions => '.txt';
Future apply(Transform transform) {
- return transform.readInput(transform.primaryInput.id).toList()
- .then((contents) {
+ return Future.wait([
+ transform.hasInput(transform.primaryInput.id),
+ transform.hasInput(new AssetId('hooble', 'whatsit'))
+ ]).then((results) {
var id = transform.primaryInput.id.changeExtension(".out");
- var asset = new Asset.fromString(id, "\$contents.out");
+ var asset = new Asset.fromString(id,
+ "primary: \${results[0]}, secondary: \${results[1]}");
transform.addOutput(asset);
});
}
@@ -31,7 +34,7 @@ class RewriteTransformer extends Transformer {
main() {
initConfig();
- integration("a transform can use readInputAsString", () {
+ integration("a transform can use hasInput", () {
d.dir(appPath, [
d.pubspec({
"name": "myapp",
@@ -48,7 +51,7 @@ main() {
createLockFile('myapp', pkg: ['barback']);
pubServe();
- requestShouldSucceed("foo.out", "[[102, 111, 111]].out");
+ requestShouldSucceed("foo.out", "primary: true, secondary: false");
endPubServe();
});
}
« no previous file with comments | « sdk/lib/_internal/pub/test/transformer/can_use_consume_primary_test.dart ('k') | tests/lib/analyzer/analyze_library.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698