| 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 f972a96fc57cf96bb752a8e8e42f6e49c1c3c1ee..6302bf190608302f6e25b8b008093c02377840c4 100644
|
| --- a/tests/compiler/dart2js/message_kind_helper.dart
|
| +++ b/tests/compiler/dart2js/message_kind_helper.dart
|
| @@ -14,8 +14,13 @@ import 'memory_compiler.dart';
|
|
|
| const String ESCAPE_REGEXP = r'[[\]{}()*+?.\\^$|]';
|
|
|
| -Compiler check(MessageKind kind, Compiler cachedCompiler) {
|
| - Expect.isNotNull(kind.howToFix);
|
| +Compiler check(MessageKind kind, Compiler cachedCompiler,
|
| + {bool expectNoHowToFix: false}) {
|
| + if (expectNoHowToFix) {
|
| + Expect.isNull(kind.howToFix);
|
| + } else {
|
| + Expect.isNotNull(kind.howToFix);
|
| + }
|
| Expect.isFalse(kind.examples.isEmpty);
|
|
|
| for (String example in kind.examples) {
|
| @@ -37,7 +42,9 @@ Compiler check(MessageKind kind, Compiler cachedCompiler) {
|
|
|
| Expect.isFalse(messages.isEmpty, 'No messages in """$example"""');
|
|
|
| - String pattern = '${kind.template}\n${kind.howToFix}'.replaceAllMapped(
|
| + 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'#\\\{[^}]*\\\}'), '.*');
|
|
|
|
|