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

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

Issue 2864363002: Remove DartString from constants. (Closed)
Patch Set: Remove toDartString Created 3 years, 7 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/optimize.dart ('k') | tests/compiler/dart2js/metadata_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Test that constants depended on by other constants are correctly deferred. 5 // Test that constants depended on by other constants are correctly deferred.
6 6
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import 'package:compiler/src/common.dart'; 8 import 'package:compiler/src/common.dart';
9 import 'package:compiler/src/constants/values.dart'; 9 import 'package:compiler/src/constants/values.dart';
10 import 'package:compiler/src/compiler.dart'; 10 import 'package:compiler/src/compiler.dart';
(...skipping 14 matching lines...) Expand all
25 List<ConstantValue> allConstants = []; 25 List<ConstantValue> allConstants = [];
26 26
27 addConstantWithDependendencies(ConstantValue c) { 27 addConstantWithDependendencies(ConstantValue c) {
28 allConstants.add(c); 28 allConstants.add(c);
29 c.getDependencies().forEach(addConstantWithDependendencies); 29 c.getDependencies().forEach(addConstantWithDependendencies);
30 } 30 }
31 31
32 backend.constants.compiledConstants.forEach(addConstantWithDependendencies); 32 backend.constants.compiledConstants.forEach(addConstantWithDependendencies);
33 for (String stringValue in ["cA", "cB", "cC"]) { 33 for (String stringValue in ["cA", "cB", "cC"]) {
34 ConstantValue constant = allConstants.firstWhere((constant) { 34 ConstantValue constant = allConstants.firstWhere((constant) {
35 return constant.isString && 35 return constant.isString && constant.primitiveValue == stringValue;
36 constant.primitiveValue.slowToString() == stringValue;
37 }); 36 });
38 Expect.notEquals(null, outputUnitForConstant(constant), 37 Expect.notEquals(null, outputUnitForConstant(constant),
39 "Constant value ${constant.toStructuredText()} has no output unit."); 38 "Constant value ${constant.toStructuredText()} has no output unit.");
40 Expect.notEquals( 39 Expect.notEquals(
41 mainOutputUnit, 40 mainOutputUnit,
42 outputUnitForConstant(constant), 41 outputUnitForConstant(constant),
43 "Constant value ${constant.toStructuredText()} " 42 "Constant value ${constant.toStructuredText()} "
44 "is in the main output unit."); 43 "is in the main output unit.");
45 } 44 }
46 }); 45 });
(...skipping 19 matching lines...) Expand all
66 """, 65 """,
67 "lib.dart": """ 66 "lib.dart": """
68 class C { 67 class C {
69 final a; 68 final a;
70 const C(this.a); 69 const C(this.a);
71 } 70 }
72 71
73 const L = const {"cA": const C(const {"cB": "cC"})}; 72 const L = const {"cA": const C(const {"cB": "cC"})};
74 """, 73 """,
75 }; 74 };
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/optimize.dart ('k') | tests/compiler/dart2js/metadata_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698