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 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 import "package:async_helper/async_helper.dart"; | 6 import "package:async_helper/async_helper.dart"; |
7 import 'memory_source_file_helper.dart'; | 7 import 'memory_source_file_helper.dart'; |
8 | 8 |
9 import 'package:compiler/compiler.dart' | 9 import 'package:compiler/compiler.dart' |
10 show Diagnostic; | 10 show Diagnostic; |
(...skipping 20 matching lines...) Expand all Loading... |
31 packageRoot, | 31 packageRoot, |
32 ['--analyze-only'], | 32 ['--analyze-only'], |
33 {}); | 33 {}); |
34 asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) { | 34 asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) { |
35 diagnostics.sort(); | 35 diagnostics.sort(); |
36 var expected = [ | 36 var expected = [ |
37 "memory:exporter.dart:43:47:'hest' is defined here.:info", | 37 "memory:exporter.dart:43:47:'hest' is defined here.:info", |
38 "memory:library.dart:41:45:'hest' is defined here.:info", | 38 "memory:library.dart:41:45:'hest' is defined here.:info", |
39 "memory:main.dart:0:22:'hest' is imported here.:info", | 39 "memory:main.dart:0:22:'hest' is imported here.:info", |
40 "memory:main.dart:23:46:'hest' is imported here.:info", | 40 "memory:main.dart:23:46:'hest' is imported here.:info", |
41 "memory:main.dart:86:92:Duplicate import of 'hest'.:error" | 41 "memory:main.dart:86:90:Duplicate import of 'hest'.:error" |
42 ]; | 42 ]; |
43 Expect.listEquals(expected, diagnostics); | 43 Expect.listEquals(expected, diagnostics); |
44 Expect.isTrue(compiler.compilationFailed); | 44 Expect.isTrue(compiler.compilationFailed); |
45 })); | 45 })); |
46 } | 46 } |
47 | 47 |
48 const Map MEMORY_SOURCE_FILES = const { | 48 const Map MEMORY_SOURCE_FILES = const { |
49 'main.dart': """ | 49 'main.dart': """ |
50 import 'library.dart'; | 50 import 'library.dart'; |
51 import 'exporter.dart'; | 51 import 'exporter.dart'; |
(...skipping 15 matching lines...) Expand all Loading... |
67 hest() {} | 67 hest() {} |
68 """, | 68 """, |
69 'exporter.dart': """ | 69 'exporter.dart': """ |
70 library exporter; | 70 library exporter; |
71 | 71 |
72 export 'library.dart'; | 72 export 'library.dart'; |
73 | 73 |
74 hest() {} | 74 hest() {} |
75 """, | 75 """, |
76 }; | 76 }; |
OLD | NEW |