| Index: tests/compiler/dart2js/missing_file_test.dart
|
| diff --git a/tests/compiler/dart2js/missing_file_test.dart b/tests/compiler/dart2js/missing_file_test.dart
|
| index 7d88eb8eb56029b250a41c93e053734c063fa68d..26a4e9b0d445fd8a063366aeba468c974422c5c5 100644
|
| --- a/tests/compiler/dart2js/missing_file_test.dart
|
| +++ b/tests/compiler/dart2js/missing_file_test.dart
|
| @@ -21,34 +21,28 @@ main() {}
|
| ''',
|
| };
|
|
|
| -Future runCompiler(Uri main, String expectedMessage) {
|
| +Future runTest(Uri main, MessageKind expectedMessageKind) async {
|
| print("\n\n\n");
|
|
|
| DiagnosticCollector diagnostics = new DiagnosticCollector();
|
| OutputCollector output = new OutputCollector();
|
| - Compiler compiler = compilerFor(
|
| - MEMORY_SOURCE_FILES,
|
| + await runCompiler(
|
| + memorySourceFiles: MEMORY_SOURCE_FILES,
|
| diagnosticHandler: diagnostics,
|
| outputProvider: output);
|
|
|
| - return compiler.run(main).then((_) {
|
| - Expect.isFalse(output.hasExtraOutput);
|
| - Expect.equals(1, diagnostics.errors.length);
|
| - Expect.equals(expectedMessage, diagnostics.errors.first.message);
|
| - });
|
| + Expect.isFalse(output.hasExtraOutput);
|
| + Expect.equals(1, diagnostics.errors.length);
|
| + Expect.equals(expectedMessageKind, diagnostics.errors.first.message.kind);
|
| }
|
|
|
| void main() {
|
| - asyncTest(() => Future.forEach([
|
| - () => runCompiler(
|
| - Uri.parse('memory:main.dart'),
|
| - "Can't read 'memory:foo.dart' "
|
| - "(Exception: No such file memory:foo.dart)."),
|
| - () => runCompiler(
|
| - Uri.parse('memory:foo.dart'),
|
| - "Exception: No such file memory:foo.dart"),
|
| - () => runCompiler(
|
| - Uri.parse('dart:foo'),
|
| - "Library not found 'dart:foo'."),
|
| - ], (f) => f()));
|
| + asyncTest(() async {
|
| + await runTest(
|
| + Uri.parse('memory:main.dart'), MessageKind.READ_SCRIPT_ERROR);
|
| + await runTest(
|
| + Uri.parse('memory:foo.dart'), MessageKind.READ_SCRIPT_ERROR);
|
| + await runTest(
|
| + Uri.parse('dart:foo'), MessageKind.READ_SCRIPT_ERROR);
|
| + });
|
| }
|
|
|