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

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

Issue 17759007: First pass at asynchronous input loading in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased 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_helper.dart
diff --git a/tests/compiler/dart2js/message_kind_helper.dart b/tests/compiler/dart2js/message_kind_helper.dart
index 6302bf190608302f6e25b8b008093c02377840c4..3ae68c3cc56f51b61aa0effd746431b3deafa8b2 100644
--- a/tests/compiler/dart2js/message_kind_helper.dart
+++ b/tests/compiler/dart2js/message_kind_helper.dart
@@ -5,6 +5,7 @@
library dart2js.test.message_kind_helper;
import 'package:expect/expect.dart';
+import 'dart:async';
import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' show
Compiler,
@@ -14,8 +15,8 @@ import 'memory_compiler.dart';
const String ESCAPE_REGEXP = r'[[\]{}()*+?.\\^$|]';
-Compiler check(MessageKind kind, Compiler cachedCompiler,
- {bool expectNoHowToFix: false}) {
+Future<Compiler> check(MessageKind kind, Compiler cachedCompiler,
+ {bool expectNoHowToFix: false}) {
if (expectNoHowToFix) {
Expect.isNull(kind.howToFix);
} else {
@@ -38,20 +39,21 @@ Compiler check(MessageKind kind, Compiler cachedCompiler,
options: ['--analyze-only'],
cachedCompiler: cachedCompiler);
- compiler.run(Uri.parse('memory:main.dart'));
+ return compiler.run(Uri.parse('memory:main.dart')).then((_) {
- Expect.isFalse(messages.isEmpty, 'No messages in """$example"""');
+ Expect.isFalse(messages.isEmpty, 'No messages in """$example"""');
- String expectedText = kind.howToFix == null
- ? kind.template : '${kind.template}\n${kind.howToFix}';
- String pattern = expectedText.replaceAllMapped(
- new RegExp(ESCAPE_REGEXP), (m) => '\\${m[0]}');
- pattern = pattern.replaceAll(new RegExp(r'#\\\{[^}]*\\\}'), '.*');
+ String expectedText = kind.howToFix == null
+ ? kind.template : '${kind.template}\n${kind.howToFix}';
+ String pattern = expectedText.replaceAllMapped(
+ new RegExp(ESCAPE_REGEXP), (m) => '\\${m[0]}');
+ pattern = pattern.replaceAll(new RegExp(r'#\\\{[^}]*\\\}'), '.*');
- for (String message in messages) {
- Expect.isTrue(new RegExp('^$pattern\$').hasMatch(message),
- '"$pattern" does not match "$message"');
- }
- return compiler;
+ for (String message in messages) {
+ Expect.isTrue(new RegExp('^$pattern\$').hasMatch(message),
+ '"$pattern" does not match "$message"');
+ }
+ return compiler;
+ });
}
}

Powered by Google App Engine
This is Rietveld 408576698