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

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

Issue 2874973003: Add more equivalence tests for ElementEnvironment (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 c0945df0fa10c003534f3c5782bb11bcaf948579..0e5c36668f463980d23ff3823ea754f9c9680a47 100644
--- a/tests/compiler/dart2js/serialization/test_helper.dart
+++ b/tests/compiler/dart2js/serialization/test_helper.dart
@@ -650,7 +650,10 @@ class KernelEquivalence {
: testing = new WorldDeconstructionForTesting(builder);
TestStrategy get defaultStrategy => new TestStrategy(
- elementEquivalence: entityEquivalence, typeEquivalence: typeEquivalence);
+ elementEquivalence: entityEquivalence,
+ typeEquivalence: typeEquivalence,
+ constantEquivalence: constantEquivalence,
+ constantValueEquivalence: constantValueEquivalence);
bool entityEquivalence(Element a, Entity b, {TestStrategy strategy}) {
if (identical(a, b)) return true;
@@ -816,4 +819,16 @@ class KernelEquivalence {
'$a (${a.runtimeType}) vs $b (${b.runtimeType})');
}
}
+
+ bool constantEquivalence(ConstantExpression exp1, ConstantExpression exp2,
+ {TestStrategy strategy}) {
+ strategy ??= defaultStrategy;
+ return areConstantsEquivalent(exp1, exp2, strategy: strategy);
+ }
+
+ bool constantValueEquivalence(ConstantValue value1, ConstantValue value2,
+ {TestStrategy strategy}) {
+ strategy ??= defaultStrategy;
+ return areConstantValuesEquivalent(value1, value2, strategy: strategy);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698