| Index: tests/compiler/dart2js/serialization/duplicate_library_test.dart
|
| diff --git a/tests/compiler/dart2js/serialization/duplicate_library_test.dart b/tests/compiler/dart2js/serialization/duplicate_library_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3380c66be35b8d1193717ebbf5f55b2f3843e6d1
|
| --- /dev/null
|
| +++ b/tests/compiler/dart2js/serialization/duplicate_library_test.dart
|
| @@ -0,0 +1,38 @@
|
| +// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +library dart2js.serialization.duplicate_libraryc_test;
|
| +
|
| +import 'dart:async';
|
| +import 'package:async_helper/async_helper.dart';
|
| +import 'package:expect/expect.dart';
|
| +import 'package:compiler/src/commandline_options.dart';
|
| +import 'package:compiler/src/common/names.dart';
|
| +import 'package:compiler/src/compiler.dart';
|
| +import 'package:compiler/src/filenames.dart';
|
| +import '../memory_compiler.dart';
|
| +import 'helper.dart';
|
| +import 'test_data.dart';
|
| +
|
| +void main(List<String> args) {
|
| + asyncTest(() async {
|
| + SerializedData data = await serializeDartCore(
|
| + arguments: new Arguments.from(args));
|
| + Map<String, String> sourceFiles = data.toMemorySourceFiles();
|
| + List<Uri> resolutionInputs = data.toUris();
|
| + Uri extraUri = Uri.parse('memory:extraUri');
|
| + sourceFiles[extraUri.path] = data.data;
|
| + resolutionInputs.add(extraUri);
|
| +
|
| + DiagnosticCollector collector = new DiagnosticCollector();
|
| + await runCompiler(
|
| + entryPoint: Uris.dart_core,
|
| + memorySourceFiles: sourceFiles,
|
| + resolutionInputs: resolutionInputs,
|
| + diagnosticHandler: collector,
|
| + options: [Flags.analyzeAll]);
|
| + Expect.isTrue(collector.errors.isNotEmpty,
|
| + "Expected duplicate serialized library errors.");
|
| + });
|
| +}
|
|
|