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