| 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 imports when package root has not been set. | 5 // Test that the compiler can handle imports when package root has not been set. |
| 6 | 6 |
| 7 library dart2js.test.missing_file; | 7 library dart2js.test.missing_file; |
| 8 | 8 |
| 9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 import 'package:async_helper/async_helper.dart'; | 10 import 'package:async_helper/async_helper.dart'; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 if (info != null) { | 47 if (info != null) { |
| 48 Expect.equals(info, diagnostics.infos.first.message.kind); | 48 Expect.equals(info, diagnostics.infos.first.message.kind); |
| 49 } | 49 } |
| 50 Expect.equals(0, diagnostics.warnings.length); | 50 Expect.equals(0, diagnostics.warnings.length); |
| 51 Expect.equals(0, diagnostics.hints.length); | 51 Expect.equals(0, diagnostics.hints.length); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void main() { | 54 void main() { |
| 55 asyncTest(() async { | 55 asyncTest(() async { |
| 56 await runTest(Uri.parse('memory:main.dart'), | 56 await runTest(Uri.parse('memory:main.dart'), |
| 57 error: MessageKind.READ_SCRIPT_ERROR); | 57 error: MessageKind.READ_URI_ERROR); |
| 58 | 58 |
| 59 await runTest(Uri.parse('memory:foo.dart'), | 59 await runTest(Uri.parse('memory:foo.dart'), |
| 60 error: MessageKind.READ_SELF_ERROR); | 60 error: MessageKind.READ_SELF_ERROR); |
| 61 | 61 |
| 62 await runTest(Uri.parse('dart:foo'), error: MessageKind.LIBRARY_NOT_FOUND); | 62 await runTest(Uri.parse('dart:foo'), error: MessageKind.LIBRARY_NOT_FOUND); |
| 63 | 63 |
| 64 await runTest(Uri.parse('dart:_mirror_helper'), | 64 await runTest(Uri.parse('dart:_mirror_helper'), |
| 65 error: MessageKind.INTERNAL_LIBRARY, | 65 error: MessageKind.INTERNAL_LIBRARY, |
| 66 info: MessageKind.DISALLOWED_LIBRARY_IMPORT); | 66 info: MessageKind.DISALLOWED_LIBRARY_IMPORT); |
| 67 | 67 |
| 68 await runTest(Uri.parse('memory:bar.dart'), | 68 await runTest(Uri.parse('memory:bar.dart'), |
| 69 error: MessageKind.LIBRARY_NOT_FOUND); | 69 error: MessageKind.LIBRARY_NOT_FOUND); |
| 70 | 70 |
| 71 // Importing dart:io is temporarily allowed as a stopgap measure for the | 71 // Importing dart:io is temporarily allowed as a stopgap measure for the |
| 72 // lack of config specific imports. Once that is added, this will be | 72 // lack of config specific imports. Once that is added, this will be |
| 73 // disallowed again. | 73 // disallowed again. |
| 74 | 74 |
| 75 //await runTest(Uri.parse('dart:io'), | 75 //await runTest(Uri.parse('dart:io'), |
| 76 // error: MessageKind.LIBRARY_NOT_SUPPORTED, | 76 // error: MessageKind.LIBRARY_NOT_SUPPORTED, |
| 77 // info: MessageKind.DISALLOWED_LIBRARY_IMPORT); | 77 // info: MessageKind.DISALLOWED_LIBRARY_IMPORT); |
| 78 | 78 |
| 79 //await runTest(Uri.parse('memory:baz.dart'), | 79 //await runTest(Uri.parse('memory:baz.dart'), |
| 80 // error: MessageKind.LIBRARY_NOT_SUPPORTED, | 80 // error: MessageKind.LIBRARY_NOT_SUPPORTED, |
| 81 // info: MessageKind.DISALLOWED_LIBRARY_IMPORT); | 81 // info: MessageKind.DISALLOWED_LIBRARY_IMPORT); |
| 82 }); | 82 }); |
| 83 } | 83 } |
| OLD | NEW |