Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: tests/compiler/dart2js/unused_empty_map_test.dart

Issue 2690063002: Refactor CompilerOutput (Closed)
Patch Set: Updated cf. comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // Ensure that unused empty HashMap nodes are dropped from the output. 5 // Ensure that unused empty HashMap nodes are dropped from the output.
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'package:compiler/compiler_new.dart';
8 import 'package:async_helper/async_helper.dart'; 9 import 'package:async_helper/async_helper.dart';
9 import 'memory_compiler.dart'; 10 import 'memory_compiler.dart';
10 11
11 const TEST_SOURCE = const { 12 const TEST_SOURCE = const {
12 "main.dart": r""" 13 "main.dart": r"""
13 void main() { 14 void main() {
14 var x = {}; 15 var x = {};
15 return; 16 return;
16 } 17 }
17 """ 18 """
18 }; 19 };
19 20
20 const HASHMAP_EMPTY_CONSTRUCTOR = r"LinkedHashMap_LinkedHashMap$_empty"; 21 const HASHMAP_EMPTY_CONSTRUCTOR = r"LinkedHashMap_LinkedHashMap$_empty";
21 22
22 main() { 23 main() {
23 asyncTest(() async { 24 asyncTest(() async {
24 var collector = new OutputCollector(); 25 var collector = new OutputCollector();
25 var result = await runCompiler( 26 var result = await runCompiler(
26 memorySourceFiles: TEST_SOURCE, outputProvider: collector); 27 memorySourceFiles: TEST_SOURCE, outputProvider: collector);
27 var compiler = result.compiler; 28 var compiler = result.compiler;
28 String generated = collector.getOutput('', 'js'); 29 String generated = collector.getOutput('', OutputType.js);
29 Expect.isFalse(generated.contains(HASHMAP_EMPTY_CONSTRUCTOR)); 30 Expect.isFalse(generated.contains(HASHMAP_EMPTY_CONSTRUCTOR));
30 }); 31 });
31 } 32 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/sourcemaps/sourcemap_helper.dart ('k') | tests/compiler/dart2js/uri_retention_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698