| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Test that the compiler can handle missing files used in imports, exports, | 5 // Test that the compiler can handle missing files used in imports, exports, |
| 6 // part tags or as the main source file. | 6 // part tags or as the main source file. |
| 7 | 7 |
| 8 library dart2js.test.import; | 8 library dart2js.test.import; |
| 9 | 9 |
| 10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 const Expected.info(MessageKind.IMPORT_PART_OF_HERE) | 64 const Expected.info(MessageKind.IMPORT_PART_OF_HERE) |
| 65 ]); | 65 ]); |
| 66 } | 66 } |
| 67 | 67 |
| 68 testMissingImports() async { | 68 testMissingImports() async { |
| 69 var collector = new DiagnosticCollector(); | 69 var collector = new DiagnosticCollector(); |
| 70 await runCompiler( | 70 await runCompiler( |
| 71 memorySourceFiles: MEMORY_SOURCE_FILES, diagnosticHandler: collector); | 71 memorySourceFiles: MEMORY_SOURCE_FILES, diagnosticHandler: collector); |
| 72 | 72 |
| 73 collector.checkMessages([ | 73 collector.checkMessages([ |
| 74 const Expected.error(MessageKind.READ_SCRIPT_ERROR), | 74 const Expected.error(MessageKind.READ_URI_ERROR), |
| 75 const Expected.error(MessageKind.LIBRARY_NOT_FOUND), | 75 const Expected.error(MessageKind.LIBRARY_NOT_FOUND), |
| 76 const Expected.error(MessageKind.LIBRARY_NOT_FOUND), | 76 const Expected.error(MessageKind.LIBRARY_NOT_FOUND), |
| 77 const Expected.error(MessageKind.READ_SCRIPT_ERROR), | 77 const Expected.error(MessageKind.READ_URI_ERROR), |
| 78 const Expected.warning(MessageKind.NOT_ASSIGNABLE) | 78 const Expected.warning(MessageKind.NOT_ASSIGNABLE) |
| 79 ]); | 79 ]); |
| 80 } | 80 } |
| 81 | 81 |
| 82 testMissingMain() async { | 82 testMissingMain() async { |
| 83 var collector = new DiagnosticCollector(); | 83 var collector = new DiagnosticCollector(); |
| 84 await runCompiler( | 84 await runCompiler( |
| 85 entryPoint: Uri.parse('memory:missing.dart'), | 85 entryPoint: Uri.parse('memory:missing.dart'), |
| 86 diagnosticHandler: collector); | 86 diagnosticHandler: collector); |
| 87 collector.checkMessages([const Expected.error(MessageKind.READ_SELF_ERROR)]); | 87 collector.checkMessages([const Expected.error(MessageKind.READ_SELF_ERROR)]); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void main() { | 90 void main() { |
| 91 asyncTest(() async { | 91 asyncTest(() async { |
| 92 await testEntryPointIsPart(); | 92 await testEntryPointIsPart(); |
| 93 await testImportPart(); | 93 await testImportPart(); |
| 94 await testMissingImports(); | 94 await testMissingImports(); |
| 95 await testMissingMain(); | 95 await testMissingMain(); |
| 96 }); | 96 }); |
| 97 } | 97 } |
| OLD | NEW |