OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.malformed_uri; | 8 library dart2js.test.malformed_uri; |
9 | 9 |
10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
11 import "package:async_helper/async_helper.dart"; | 11 import "package:async_helper/async_helper.dart"; |
12 import 'memory_compiler.dart'; | 12 import 'memory_compiler.dart'; |
13 | 13 |
14 const MEMORY_SOURCE_FILES = const { | 14 const MEMORY_SOURCE_FILES = const { |
15 'main.dart': ''' | 15 'main.dart': ''' |
16 import '../../Udyn[mic ils/expect.dart'; | 16 import '../../Udyn[mic ils/expect.dart'; |
17 | 17 |
18 main () { print("Hi"); } | 18 main () { print("Hi"); } |
19 ''', | 19 ''', |
20 }; | 20 }; |
21 | 21 |
22 testMalformedUri() { | 22 testMalformedUri() { |
23 asyncTest(() async { | 23 asyncTest(() async { |
24 var collector = new DiagnosticCollector(); | 24 var collector = new DiagnosticCollector(); |
25 await runCompiler( | 25 await runCompiler( |
26 memorySourceFiles: MEMORY_SOURCE_FILES, | 26 memorySourceFiles: MEMORY_SOURCE_FILES, diagnosticHandler: collector); |
27 diagnosticHandler: collector); | |
28 Expect.equals(1, collector.errors.length); | 27 Expect.equals(1, collector.errors.length); |
29 }); | 28 }); |
30 } | 29 } |
31 | 30 |
32 void main() { | 31 void main() { |
33 testMalformedUri(); | 32 testMalformedUri(); |
34 } | 33 } |
OLD | NEW |