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

Unified Diff: tests/compiler/dart2js/message_kind_helper.dart

Issue 23684057: Support new import rules. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 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
« no previous file with comments | « tests/compiler/dart2js/diagnose_ambiguous_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/message_kind_helper.dart
diff --git a/tests/compiler/dart2js/message_kind_helper.dart b/tests/compiler/dart2js/message_kind_helper.dart
index b702d021e1d738ec8701e8dfaf0cc61f7b88bf5d..4c513eaeb6a28a7695218b000c234696ad13954c 100644
--- a/tests/compiler/dart2js/message_kind_helper.dart
+++ b/tests/compiler/dart2js/message_kind_helper.dart
@@ -19,7 +19,15 @@ Future<Compiler> check(MessageKind kind, Compiler cachedCompiler) {
Expect.isNotNull(kind.howToFix);
Expect.isFalse(kind.examples.isEmpty);
- for (String example in kind.examples) {
+ return Future.forEach(kind.examples, (example) {
+ if (example is String) {
+ example = {'main.dart': example};
+ } else {
+ Expect.isTrue(example is Map,
+ "Example must be either a String or a Map.");
+ Expect.isTrue(example.containsKey('main.dart'),
+ "Example map must contain a 'main.dart' entry.");
+ }
List<String> messages = <String>[];
void collect(Uri uri, int begin, int end, String message, kind) {
if (kind.name == 'verbose info') {
@@ -29,7 +37,7 @@ Future<Compiler> check(MessageKind kind, Compiler cachedCompiler) {
}
Compiler compiler = compilerFor(
- {'main.dart': example},
+ example,
diagnosticHandler: collect,
options: ['--analyze-only'],
cachedCompiler: cachedCompiler);
@@ -53,9 +61,7 @@ Future<Compiler> check(MessageKind kind, Compiler cachedCompiler) {
}
}
Expect.isTrue(messageFound, '"$pattern" does not match any in $messages');
- return compiler;
+ cachedCompiler = compiler;
});
- }
-
- return new Future<Compiler>.sync(cachedCompiler);
+ }).then((_) => cachedCompiler);
}
« no previous file with comments | « tests/compiler/dart2js/diagnose_ambiguous_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698