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

Unified Diff: tests/compiler/dart2js/serialization/test_helper.dart

Issue 1967073002: Check closure data for serialization (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/serialization/resolved_ast_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/serialization/test_helper.dart
diff --git a/tests/compiler/dart2js/serialization/test_helper.dart b/tests/compiler/dart2js/serialization/test_helper.dart
index d753b53a4c0f09d246eb52a733cee0b44eb31e4c..fd2cb41e54b52fc37cbc7c90e1056c578cb2142b 100644
--- a/tests/compiler/dart2js/serialization/test_helper.dart
+++ b/tests/compiler/dart2js/serialization/test_helper.dart
@@ -163,7 +163,8 @@ Set computeSetDifference(
Iterable set2,
List common,
List unfound,
- [bool sameElement(a, b) = equality]) {
+ {bool sameElement(a, b): equality,
+ void checkElements(a, b)}) {
// TODO(johnniwinther): Avoid the quadratic cost here. Some ideas:
// - convert each set to a list and sort it first, then compare by walking
// both lists in parallel
@@ -175,6 +176,9 @@ Set computeSetDifference(
bool found = false;
for (var element2 in remaining) {
if (sameElement(element1, element2)) {
+ if (checkElements != null) {
+ checkElements(element1, element2);
+ }
found = true;
remaining.remove(element2);
break;
@@ -199,11 +203,13 @@ bool checkSetEquivalence(
String property,
Iterable set1,
Iterable set2,
- bool sameElement(a, b)) {
+ bool sameElement(a, b),
+ {void onSameElement(a, b)}) {
List common = [];
List unfound = [];
Set remaining =
- computeSetDifference(set1, set2, common, unfound, sameElement);
+ computeSetDifference(set1, set2, common, unfound,
+ sameElement: sameElement, checkElements: onSameElement);
if (unfound.isNotEmpty || remaining.isNotEmpty) {
String message =
"Set mismatch for `$property` on $object1 vs $object2: \n"
« no previous file with comments | « tests/compiler/dart2js/serialization/resolved_ast_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698