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

Side by Side Diff: tests/compiler/dart2js/serialization/test_helper.dart

Issue 2359453002: Handle local functions in kernel_impact. (Closed)
Patch Set: Updated cf. comments. Created 4 years, 3 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/kernel/impact_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:collection'; 7 import 'dart:collection';
8 import 'package:compiler/src/common/resolution.dart'; 8 import 'package:compiler/src/common/resolution.dart';
9 import 'package:compiler/src/constants/expressions.dart'; 9 import 'package:compiler/src/constants/expressions.dart';
10 import 'package:compiler/src/constants/values.dart'; 10 import 'package:compiler/src/constants/values.dart';
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 /// 233 ///
234 /// Uses [object1], [object2] and [property] to provide context for failures. 234 /// Uses [object1], [object2] and [property] to provide context for failures.
235 bool checkSetEquivalence(var object1, var object2, String property, 235 bool checkSetEquivalence(var object1, var object2, String property,
236 Iterable set1, Iterable set2, bool sameElement(a, b), 236 Iterable set1, Iterable set2, bool sameElement(a, b),
237 {void onSameElement(a, b)}) { 237 {void onSameElement(a, b)}) {
238 List<List> common = <List>[]; 238 List<List> common = <List>[];
239 List unfound = []; 239 List unfound = [];
240 Set remaining = computeSetDifference(set1, set2, common, unfound, 240 Set remaining = computeSetDifference(set1, set2, common, unfound,
241 sameElement: sameElement, checkElements: onSameElement); 241 sameElement: sameElement, checkElements: onSameElement);
242 if (unfound.isNotEmpty || remaining.isNotEmpty) { 242 if (unfound.isNotEmpty || remaining.isNotEmpty) {
243 String message = "Set mismatch for `$property` on $object1 vs $object2: \n" 243 String message = "Set mismatch for `$property` on\n"
244 "$object1\n vs\n$object2:\n"
244 "Common:\n ${common.join('\n ')}\n" 245 "Common:\n ${common.join('\n ')}\n"
245 "Unfound:\n ${unfound.join('\n ')}\n" 246 "Unfound:\n ${unfound.join('\n ')}\n"
246 "Extra: \n ${remaining.join('\n ')}"; 247 "Extra: \n ${remaining.join('\n ')}";
247 throw message; 248 throw message;
248 } 249 }
249 return true; 250 return true;
250 } 251 }
251 252
252 /// Check equivalence of the two iterables, [set1] and [set1], as sets using 253 /// Check equivalence of the two iterables, [set1] and [set1], as sets using
253 /// [elementEquivalence] to compute the pair-wise equivalence. 254 /// [elementEquivalence] to compute the pair-wise equivalence.
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 } 642 }
642 643
643 if (index == 1 && skip != 0) { 644 if (index == 1 && skip != 0) {
644 return ['${skip}', segmentNumber(index)]; 645 return ['${skip}', segmentNumber(index)];
645 } else if (index == count) { 646 } else if (index == count) {
646 return [segmentNumber(index - 1)]; 647 return [segmentNumber(index - 1)];
647 } else { 648 } else {
648 return [segmentNumber(index - 1), segmentNumber(index)]; 649 return [segmentNumber(index - 1), segmentNumber(index)];
649 } 650 }
650 } 651 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/kernel/impact_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698