| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2017, 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 import 'dart:async'; |
| 6 import 'package:async_helper/async_helper.dart'; |
| 7 import 'package:compiler/compiler_new.dart'; |
| 8 import 'package:compiler/src/commandline_options.dart'; |
| 9 import 'package:expect/expect.dart'; |
| 10 import '../memory_compiler.dart'; |
| 11 |
| 12 main() { |
| 13 asyncTest(() async { |
| 14 String oldMap = (await compile([])).getOutput('', OutputType.js_map); |
| 15 String newMap = (await compile([Flags.useNewSourceInfo])) |
| 16 .getOutput('', OutputType.js_map); |
| 17 OutputCollector multiCollector1 = await compile([Flags.useMultiSourceInfo]); |
| 18 String multiMap1a = multiCollector1.getOutput('', OutputType.js_map); |
| 19 String multiMap1b = multiCollector1.getOutput('out.js', OutputType.js_map); |
| 20 Expect.equals(oldMap, multiMap1a); |
| 21 Expect.equals(newMap, multiMap1b); |
| 22 OutputCollector multiCollector2 = |
| 23 await compile([Flags.useMultiSourceInfo, Flags.useNewSourceInfo]); |
| 24 String multiMap2a = multiCollector2.getOutput('', OutputType.js_map); |
| 25 String multiMap2b = multiCollector2.getOutput('out.js', OutputType.js_map); |
| 26 Expect.equals(newMap, multiMap2a); |
| 27 Expect.equals(oldMap, multiMap2b); |
| 28 }); |
| 29 } |
| 30 |
| 31 Future<OutputCollector> compile(List<String> options) async { |
| 32 OutputCollector collector = new OutputCollector(); |
| 33 await runCompiler( |
| 34 entryPoint: Uri.parse('memory:main.dart'), |
| 35 memorySourceFiles: const {'main.dart': 'main() {}'}, |
| 36 outputProvider: collector, |
| 37 options: options); |
| 38 return collector; |
| 39 } |
| OLD | NEW |