| Index: tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart
|
| diff --git a/tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart b/tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..47740b305f4ed28701ae9cbb5062d0bcae902a27
|
| --- /dev/null
|
| +++ b/tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart
|
| @@ -0,0 +1,39 @@
|
| +// Copyright (c) 2017, 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.
|
| +
|
| +import 'dart:async';
|
| +import 'package:async_helper/async_helper.dart';
|
| +import 'package:compiler/compiler_new.dart';
|
| +import 'package:compiler/src/commandline_options.dart';
|
| +import 'package:expect/expect.dart';
|
| +import '../memory_compiler.dart';
|
| +
|
| +main() {
|
| + asyncTest(() async {
|
| + String oldMap = (await compile([])).getOutput('', OutputType.js_map);
|
| + String newMap = (await compile([Flags.useNewSourceInfo]))
|
| + .getOutput('', OutputType.js_map);
|
| + OutputCollector multiCollector1 = await compile([Flags.useMultiSourceInfo]);
|
| + String multiMap1a = multiCollector1.getOutput('', OutputType.js_map);
|
| + String multiMap1b = multiCollector1.getOutput('out.js', OutputType.js_map);
|
| + Expect.equals(oldMap, multiMap1a);
|
| + Expect.equals(newMap, multiMap1b);
|
| + OutputCollector multiCollector2 =
|
| + await compile([Flags.useMultiSourceInfo, Flags.useNewSourceInfo]);
|
| + String multiMap2a = multiCollector2.getOutput('', OutputType.js_map);
|
| + String multiMap2b = multiCollector2.getOutput('out.js', OutputType.js_map);
|
| + Expect.equals(newMap, multiMap2a);
|
| + Expect.equals(oldMap, multiMap2b);
|
| + });
|
| +}
|
| +
|
| +Future<OutputCollector> compile(List<String> options) async {
|
| + OutputCollector collector = new OutputCollector();
|
| + await runCompiler(
|
| + entryPoint: Uri.parse('memory:main.dart'),
|
| + memorySourceFiles: const {'main.dart': 'main() {}'},
|
| + outputProvider: collector,
|
| + options: options);
|
| + return collector;
|
| +}
|
|
|