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

Unified Diff: pkg/kernel/test/class_hierarchy_test.dart

Issue 2924713002: Replace ClassHierarchy.classes with getOrderedClasses(). (Closed)
Patch Set: Update getOrderedClasses() to return only given classes. Created 3 years, 6 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 | « pkg/kernel/lib/transformations/insert_covariance_checks.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/test/class_hierarchy_test.dart
diff --git a/pkg/kernel/test/class_hierarchy_test.dart b/pkg/kernel/test/class_hierarchy_test.dart
index 8cb8fa97d937a8484950d8c3207e0e64968e7a52..d55a8524d7d73f382ebf3130f1992792dae0ef26 100644
--- a/pkg/kernel/test/class_hierarchy_test.dart
+++ b/pkg/kernel/test/class_hierarchy_test.dart
@@ -796,6 +796,25 @@ class C implements self::B {}
expect(hierarchy.getInterfaceMember(c, bSetterName, setter: true), bSetter);
}
+ void test_getOrderedClasses() {
+ var a = addClass(new Class(name: 'A', supertype: objectSuper));
+ var b = addClass(new Class(name: 'B', supertype: a.asThisSupertype));
+ var c = addClass(new Class(name: 'C', supertype: b.asThisSupertype));
+
+ void assertOrderOfClasses(List<Class> unordered, List<Class> expected) {
+ var ordered = hierarchy.getOrderedClasses(unordered);
+ expect(ordered, expected);
+ }
+
+ assertOrderOfClasses([a, b, c], [a, b, c]);
+ assertOrderOfClasses([b, a, c], [a, b, c]);
+ assertOrderOfClasses([a, c, b], [a, b, c]);
+ assertOrderOfClasses([b, c, a], [a, b, c]);
+ assertOrderOfClasses([c, a, b], [a, b, c]);
+ assertOrderOfClasses([c, b, a], [a, b, c]);
+ assertOrderOfClasses([c, b], [b, c]);
+ }
+
void test_getRankedSuperclasses() {
var a = addImplementsClass('A', []);
var b = addImplementsClass('B', [a]);
« no previous file with comments | « pkg/kernel/lib/transformations/insert_covariance_checks.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698