OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library dart2js.serialization.duplicate_libraryc_test; | 5 library dart2js.serialization.duplicate_libraryc_test; |
6 | 6 |
7 import 'dart:async'; | |
8 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
9 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
10 import 'package:compiler/src/commandline_options.dart'; | 9 import 'package:compiler/src/commandline_options.dart'; |
11 import 'package:compiler/src/common/names.dart'; | 10 import 'package:compiler/src/common/names.dart'; |
12 import 'package:compiler/src/compiler.dart'; | |
13 import 'package:compiler/src/filenames.dart'; | |
14 import '../memory_compiler.dart'; | 11 import '../memory_compiler.dart'; |
15 import 'helper.dart'; | 12 import 'helper.dart'; |
16 import 'test_data.dart'; | |
17 | 13 |
18 void main(List<String> args) { | 14 void main(List<String> args) { |
19 asyncTest(() async { | 15 asyncTest(() async { |
20 SerializedData data = | 16 SerializedData data = |
21 await serializeDartCore(arguments: new Arguments.from(args)); | 17 await serializeDartCore(arguments: new Arguments.from(args)); |
22 Map<String, String> sourceFiles = data.toMemorySourceFiles(); | 18 Map<String, String> sourceFiles = data.toMemorySourceFiles(); |
23 List<Uri> resolutionInputs = data.toUris(); | 19 List<Uri> resolutionInputs = data.toUris(); |
24 Uri extraUri = Uri.parse('memory:extraUri'); | 20 Uri extraUri = Uri.parse('memory:extraUri'); |
25 sourceFiles[extraUri.path] = data.data; | 21 sourceFiles[extraUri.path] = data.data; |
26 resolutionInputs.add(extraUri); | 22 resolutionInputs.add(extraUri); |
27 | 23 |
28 DiagnosticCollector collector = new DiagnosticCollector(); | 24 DiagnosticCollector collector = new DiagnosticCollector(); |
29 await runCompiler( | 25 await runCompiler( |
30 entryPoint: Uris.dart_core, | 26 entryPoint: Uris.dart_core, |
31 memorySourceFiles: sourceFiles, | 27 memorySourceFiles: sourceFiles, |
32 resolutionInputs: resolutionInputs, | 28 resolutionInputs: resolutionInputs, |
33 diagnosticHandler: collector, | 29 diagnosticHandler: collector, |
34 options: [Flags.analyzeAll]); | 30 options: [Flags.analyzeAll]); |
35 Expect.isTrue(collector.errors.isNotEmpty, | 31 Expect.isTrue(collector.errors.isNotEmpty, |
36 "Expected duplicate serialized library errors."); | 32 "Expected duplicate serialized library errors."); |
37 }); | 33 }); |
38 } | 34 } |
OLD | NEW |