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

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: 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
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 b7163fe8369661572f6b0ebb4ab7ffd982207404..b4c554027bb7a3a1a5b008ce87f19d332cec04d3 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,7 +15,7 @@ import 'memory_compiler.dart';
const String ESCAPE_REGEXP = r'[[\]{}()*+?.\\^$|]';
-Compiler check(MessageKind kind, Compiler cachedCompiler) {
+Future<Compiler> check(MessageKind kind, Compiler cachedCompiler) {
Expect.isNotNull(kind.howToFix);
Expect.isFalse(kind.examples.isEmpty);
@@ -33,21 +34,22 @@ 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.hasHowToFix
- ? 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.hasHowToFix
+ ? 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"');
- }
- cachedCompiler = compiler;
+ for (String message in messages) {
+ Expect.isTrue(new RegExp('^$pattern\$').hasMatch(message),
+ '"$pattern" does not match "$message"');
+ }
+ return compiler;
+ });
}
return cachedCompiler;
« no previous file with comments | « tests/compiler/dart2js/memory_source_file_helper.dart ('k') | tests/compiler/dart2js/message_kind_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698