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 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
10 import "package:async_helper/async_helper.dart"; | 10 import "package:async_helper/async_helper.dart"; |
11 import 'memory_source_file_helper.dart'; | 11 import 'memory_source_file_helper.dart'; |
12 | 12 |
13 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' | 13 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' |
14 show NullSink; | 14 show NullSink; |
15 | 15 |
16 import '../../../sdk/lib/_internal/compiler/compiler.dart' | 16 import '../../../sdk/lib/_internal/compiler/compiler.dart' |
17 show DiagnosticHandler, Diagnostic; | 17 show DiagnosticHandler, Diagnostic; |
18 | 18 |
19 import 'dart:async'; | 19 import 'dart:async'; |
20 | 20 |
21 import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart'
; | |
22 import '../../../sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirro
r.dart'; | |
23 | |
24 const MEMORY_SOURCE_FILES = const { | 21 const MEMORY_SOURCE_FILES = const { |
25 'main.dart': ''' | 22 'main.dart': ''' |
26 | 23 |
27 import 'foo.dart'; | 24 import 'foo.dart'; |
28 | 25 |
29 main() {} | 26 main() {} |
30 ''', | 27 ''', |
31 }; | 28 }; |
32 | 29 |
33 void runCompiler(Uri main, String expectedMessage) { | 30 void runCompiler(Uri main, String expectedMessage) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void main() { | 67 void main() { |
71 runCompiler(Uri.parse('memory:main.dart'), | 68 runCompiler(Uri.parse('memory:main.dart'), |
72 "Error: Can't read 'memory:foo.dart' " | 69 "Error: Can't read 'memory:foo.dart' " |
73 "(Exception: No such file memory:foo.dart)."); | 70 "(Exception: No such file memory:foo.dart)."); |
74 runCompiler(Uri.parse('memory:foo.dart'), | 71 runCompiler(Uri.parse('memory:foo.dart'), |
75 "Error: Can't read 'memory:foo.dart' " | 72 "Error: Can't read 'memory:foo.dart' " |
76 "(Exception: No such file memory:foo.dart)."); | 73 "(Exception: No such file memory:foo.dart)."); |
77 runCompiler(Uri.parse('dart:foo'), | 74 runCompiler(Uri.parse('dart:foo'), |
78 "Error: Library not found 'dart:foo'."); | 75 "Error: Library not found 'dart:foo'."); |
79 } | 76 } |
OLD | NEW |