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

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

Issue 21544003: Handle missing imports/exports/parts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add example to warning. Created 7 years, 4 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: tests/compiler/dart2js/message_kind_test.dart
diff --git a/tests/compiler/dart2js/message_kind_test.dart b/tests/compiler/dart2js/message_kind_test.dart
index 55f9beda001e3654586d26090ba90c8dff090faf..6a2e64119732061dd7f5802e00f844c31d16e551 100644
--- a/tests/compiler/dart2js/message_kind_test.dart
+++ b/tests/compiler/dart2js/message_kind_test.dart
@@ -27,9 +27,15 @@ main() {
}
});
List<String> names = kinds.keys.toList()..sort();
- List<String> examples = <String>[];
+ Map<String, bool> examples = <String, bool>{};
for (String name in names) {
MessageKind kind = kinds[name];
+ bool expectNoHowToFix = false;
+ if (name == 'READ_SCRIPT_ERROR') {
+ // For this we can give no how-to-fix since the underlying error is
+ // unknown.
+ expectNoHowToFix = true;
+ }
if (name == 'GENERIC' // Shouldn't be used.
// We can't provoke a crash.
|| name == 'COMPILER_CRASHED'
@@ -37,16 +43,17 @@ main() {
// We cannot provide examples for patch errors.
|| name.startsWith('PATCH_')) continue;
if (kind.examples != null) {
- examples.add(name);
+ examples[name] = expectNoHowToFix;
} else {
print("No example in '$name'");
}
};
var cachedCompiler;
- for (String name in examples) {
+ examples.forEach((String name, bool expectNoHowToFix) {
Stopwatch sw = new Stopwatch()..start();
- cachedCompiler = check(kinds[name], cachedCompiler);
+ cachedCompiler = check(kinds[name], cachedCompiler,
+ expectNoHowToFix: expectNoHowToFix);
sw.stop();
print("Checked '$name' in ${sw.elapsedMilliseconds}ms.");
- }
+ });
}

Powered by Google App Engine
This is Rietveld 408576698