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