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

Unified Diff: tests/compiler/dart2js/world_test.dart

Issue 1234053002: Add SubclassNode to prepare for optimized queries on ClassWorld. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 5 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/class_set_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/world_test.dart
diff --git a/tests/compiler/dart2js/world_test.dart b/tests/compiler/dart2js/world_test.dart
index 436b3d77ce470ccf196012c2ae38cbfdbeb8d3ed..4acd90f21f5db9977c54aaf1ba8039b9010dc474 100644
--- a/tests/compiler/dart2js/world_test.dart
+++ b/tests/compiler/dart2js/world_test.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -15,7 +15,8 @@ void main() {
asyncTest(() => TypeEnvironment.create(r"""
class A {}
class B {}
- class C extends A {}
+ class C_Super extends A {}
+ class C extends C_Super {}
class D implements A {}
class E extends B implements A {}
class F extends Object with A implements B {}
@@ -63,6 +64,18 @@ void main() {
}
}
+ void testSubclasses(
+ ClassElement cls,
+ List<ClassElement> expectedClasses,
+ {bool exact: true}) {
+ check(
+ 'subclassesOf',
+ cls,
+ classWorld.subclassesOf(cls),
+ expectedClasses,
+ exact: exact);
+ }
+
void testStrictSubclasses(
ClassElement cls,
List<ClassElement> expectedClasses,
@@ -99,6 +112,15 @@ void main() {
exact: exact);
}
+ testSubclasses(Object_, [A, B, C, D, E, F, G], exact: false);
+ testSubclasses(A, [A, C]);
+ testSubclasses(B, [B, E]);
+ testSubclasses(C, [C]);
+ testSubclasses(D, [D]);
+ testSubclasses(E, [E]);
+ testSubclasses(F, [F]);
+ testSubclasses(G, [G]);
+
testStrictSubclasses(Object_, [A, B, C, D, E, F, G], exact: false);
testStrictSubclasses(A, [C]);
testStrictSubclasses(B, [E]);
« no previous file with comments | « tests/compiler/dart2js/class_set_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698