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

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

Issue 2873113004: Add equivalence check of NativeData and InterceptorData (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
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 32006deb235d0ec80b4a4a9505ef6d02138941fa..c0945df0fa10c003534f3c5782bb11bcaf948579 100644
--- a/tests/compiler/dart2js/serialization/test_helper.dart
+++ b/tests/compiler/dart2js/serialization/test_helper.dart
@@ -228,17 +228,18 @@ bool checkSetEquivalence(var object1, var object2, String property,
///
/// Uses [object1], [object2] and [property] to provide context for failures.
bool checkMapEquivalence(var object1, var object2, String property, Map map1,
- Map map2, bool sameKey(a, b), bool sameValue(a, b)) {
+ Map map2, bool sameKey(a, b), bool sameValue(a, b),
+ {bool allowExtra: false}) {
List<List> common = <List>[];
List unfound = [];
- Set remaining = computeSetDifference(map1.keys, map2.keys, common, unfound,
+ Set extra = computeSetDifference(map1.keys, map2.keys, common, unfound,
sameElement: sameKey);
- if (unfound.isNotEmpty || remaining.isNotEmpty) {
+ if (unfound.isNotEmpty || (!allowExtra && extra.isNotEmpty)) {
String message =
"Map key mismatch for `$property` on $object1 vs $object2: \n"
"Common:\n ${common.join('\n ')}\n"
"Unfound:\n ${unfound.join('\n ')}\n"
- "Extra: \n ${remaining.join('\n ')}";
+ "Extra: \n ${extra.join('\n ')}";
throw message;
}
for (List pair in common) {

Powered by Google App Engine
This is Rietveld 408576698