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

Side by Side Diff: tests/compiler/dart2js/equivalence/check_functions.dart

Issue 2969073002: Add most equivalence tests to js_model/model_test (Closed)
Patch Set: Created 3 years, 5 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) 2017, the Dart project authors. Please see the AUTHORS file 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 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 /// Equivalence test functions for data objects. 5 /// Equivalence test functions for data objects.
6 6
7 library dart2js.equivalence.functions; 7 library dart2js.equivalence.functions;
8 8
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 import 'package:compiler/src/common/resolution.dart'; 10 import 'package:compiler/src/common/resolution.dart';
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 equality); 131 equality);
132 } 132 }
133 133
134 void checkInterceptorData(InterceptorDataImpl data1, InterceptorDataImpl data2, 134 void checkInterceptorData(InterceptorDataImpl data1, InterceptorDataImpl data2,
135 bool elementEquivalence(Entity a, Entity b), 135 bool elementEquivalence(Entity a, Entity b),
136 {bool verbose: false}) { 136 {bool verbose: false}) {
137 checkMapEquivalence( 137 checkMapEquivalence(
138 data1, 138 data1,
139 data2, 139 data2,
140 'interceptedElements', 140 'interceptedElements',
141 data1.interceptedElementsForTesting, 141 data1.interceptedMembers,
142 data2.interceptedElementsForTesting, 142 data2.interceptedMembers,
143 equality, 143 equality,
144 (a, b) => areSetsEquivalent(a, b, elementEquivalence)); 144 (a, b) => areSetsEquivalent(a, b, elementEquivalence));
145 145
146 checkSetEquivalence(data1, data2, 'interceptedClasses', 146 checkSetEquivalence(data1, data2, 'interceptedClasses',
147 data1.interceptedClasses, data2.interceptedClasses, elementEquivalence); 147 data1.interceptedClasses, data2.interceptedClasses, elementEquivalence);
148 148
149 checkSetEquivalence( 149 checkSetEquivalence(
150 data1, 150 data1,
151 data2, 151 data2,
152 'classesMixedIntoInterceptedClasses', 152 'classesMixedIntoInterceptedClasses',
153 data1.classesMixedIntoInterceptedClassesForTesting, 153 data1.classesMixedIntoInterceptedClasses,
154 data2.classesMixedIntoInterceptedClassesForTesting, 154 data2.classesMixedIntoInterceptedClasses,
155 elementEquivalence); 155 elementEquivalence);
156 } 156 }
157 157
158 void checkClassHierarchyNodes( 158 void checkClassHierarchyNodes(
159 ClosedWorld closedWorld1, 159 ClosedWorld closedWorld1,
160 ClosedWorld closedWorld2, 160 ClosedWorld closedWorld2,
161 ClassHierarchyNode node1, 161 ClassHierarchyNode node1,
162 ClassHierarchyNode node2, 162 ClassHierarchyNode node2,
163 bool elementEquivalence(Entity a, Entity b), 163 bool elementEquivalence(Entity a, Entity b),
164 {bool verbose: false, 164 {bool verbose: false,
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 return testNodes(node.expression, other.expression); 1408 return testNodes(node.expression, other.expression);
1409 } 1409 }
1410 1410
1411 @override 1411 @override
1412 bool visitBlock(js.Block node) { 1412 bool visitBlock(js.Block node) {
1413 if (peek() is! js.Block) return failAt(node, peek()); 1413 if (peek() is! js.Block) return failAt(node, peek());
1414 js.Block other = peek(); 1414 js.Block other = peek();
1415 return testNodeLists(node.statements, other.statements); 1415 return testNodeLists(node.statements, other.statements);
1416 } 1416 }
1417 } 1417 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698