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

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

Issue 1919143002: Store constant variable initializers in elements. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 8 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 | « tests/compiler/dart2js/serialization_test.dart ('k') | no next file » | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library dart2js.serialization_test_helper; 5 library dart2js.serialization_test_helper;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'memory_compiler.dart'; 8 import 'memory_compiler.dart';
9 import 'package:async_helper/async_helper.dart'; 9 import 'package:async_helper/async_helper.dart';
10 import 'package:compiler/src/common/resolution.dart'; 10 import 'package:compiler/src/common/resolution.dart';
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return checkConstantLists(object1, object2, property, list1, list2); 98 return checkConstantLists(object1, object2, property, list1, list2);
99 } 99 }
100 } 100 }
101 101
102 /// Check that the values [property] of [object1] and [object2], [value1] and 102 /// Check that the values [property] of [object1] and [object2], [value1] and
103 /// [value2] respectively, are equal and throw otherwise. 103 /// [value2] respectively, are equal and throw otherwise.
104 bool check(var object1, var object2, String property, var value1, var value2, 104 bool check(var object1, var object2, String property, var value1, var value2,
105 [bool equivalence(a, b) = equality]) { 105 [bool equivalence(a, b) = equality]) {
106 if (!equivalence(value1, value2)) { 106 if (!equivalence(value1, value2)) {
107 throw "property='$property'\n " 107 throw "property='$property'\n "
108 "object1=$object1 (${object1.runtimeType})\n value='${value1}' <>\n " 108 "object1=$object1 (${object1.runtimeType})\n "
109 "object2=$object2 (${object2.runtimeType})\n value='${value2}'"; 109 "value=${value1 == null ? "null" : "'$value1'"} "
110 "(${value1.runtimeType}) <>\n "
111 "object2=$object2 (${object2.runtimeType})\n "
112 "value=${value2 == null ? "null" : "'$value2'"} "
113 "(${value2.runtimeType})";
110 } 114 }
111 return true; 115 return true;
112 } 116 }
113 117
114 /// Check equivalence of the two lists, [list1] and [list2], using 118 /// Check equivalence of the two lists, [list1] and [list2], using
115 /// [checkEquivalence] to check the pair-wise equivalence. 119 /// [checkEquivalence] to check the pair-wise equivalence.
116 /// 120 ///
117 /// Uses [object1], [object2] and [property] to provide context for failures. 121 /// Uses [object1], [object2] and [property] to provide context for failures.
118 bool checkListEquivalence( 122 bool checkListEquivalence(
119 Object object1, Object object2, String property, 123 Object object1, Object object2, String property,
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 373
370 if (impact1 == null) { 374 if (impact1 == null) {
371 throw 'Missing impact for $member1. $member2 has $impact2'; 375 throw 'Missing impact for $member1. $member2 has $impact2';
372 } 376 }
373 if (impact2 == null) { 377 if (impact2 == null) {
374 throw 'Missing impact for $member2. $member1 has $impact1'; 378 throw 'Missing impact for $member2. $member1 has $impact1';
375 } 379 }
376 380
377 testResolutionImpactEquivalence(impact1, impact2, const CheckStrategy()); 381 testResolutionImpactEquivalence(impact1, impact2, const CheckStrategy());
378 } 382 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/serialization_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698