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

Unified Diff: pkg/analysis_server/test/search/type_hierarchy_test.dart

Issue 1406403009: Fix for the case when a class appears twice in a type hierarchy. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/analysis_server/lib/src/search/type_hierarchy.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/search/type_hierarchy_test.dart
diff --git a/pkg/analysis_server/test/search/type_hierarchy_test.dart b/pkg/analysis_server/test/search/type_hierarchy_test.dart
index 037d7bb9f74e3f957f2d5710c17a61a49fe70630..1d6ddf9ac1b29d013d1f8bf84a6099d32aafcc3a 100644
--- a/pkg/analysis_server/test/search/type_hierarchy_test.dart
+++ b/pkg/analysis_server/test/search/type_hierarchy_test.dart
@@ -75,7 +75,7 @@ class B extends A {
'superclass': 1,
'interfaces': [],
'mixins': [],
- 'subclasses': []
+ 'subclasses': [1]
},
{
'classElement': {
@@ -87,7 +87,7 @@ class B extends A {
'superclass': 0,
'interfaces': [],
'mixins': [],
- 'subclasses': [1]
+ 'subclasses': []
}
]);
}
@@ -107,6 +107,66 @@ class B extends A<int> {
expect(itemA.displayName, 'A<int>');
}
+ test_class_double_subclass() async {
+ addTestFile('''
+class AAA {} // A
+
+class BBB extends AAA {}
+
+class CCC extends BBB implements AAA {}
+''');
+ List<TypeHierarchyItem> items = await _getTypeHierarchy('AAA {} // A');
+ expect(_toJson(items), [
+ {
+ 'classElement': {
+ 'kind': 'CLASS',
+ 'name': 'AAA',
+ 'location': anything,
+ 'flags': 0
+ },
+ 'superclass': 1,
+ 'interfaces': [],
+ 'mixins': [],
+ 'subclasses': [2, 3]
+ },
+ {
+ 'classElement': {
+ 'kind': 'CLASS',
+ 'name': 'Object',
+ 'location': anything,
+ 'flags': 0
+ },
+ 'interfaces': [],
+ 'mixins': [],
+ 'subclasses': []
+ },
+ {
+ 'classElement': {
+ 'kind': 'CLASS',
+ 'name': 'CCC',
+ 'location': anything,
+ 'flags': 0
+ },
+ 'superclass': 0,
+ 'interfaces': [],
+ 'mixins': [],
+ 'subclasses': []
+ },
+ {
+ 'classElement': {
+ 'kind': 'CLASS',
+ 'name': 'BBB',
+ 'location': anything,
+ 'flags': 0
+ },
+ 'superclass': 0,
+ 'interfaces': [],
+ 'mixins': [],
+ 'subclasses': [2]
+ }
+ ]);
+ }
+
test_class_extends_fileAndPackageUris() async {
// prepare packages
String pkgFile = '/packages/pkgA/libA.dart';
« no previous file with comments | « pkg/analysis_server/lib/src/search/type_hierarchy.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698