| 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;
|
| + });
|
| }
|
| }
|
|
|