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

Unified Diff: pkg/analyzer/test/src/dart/analysis/search_test.dart

Issue 2557543002: Implement search for direct subtypes and enable `search.getTypeHierarchy` request. (Closed)
Patch Set: Created 4 years 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/analyzer/lib/src/dart/analysis/search.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/dart/analysis/search_test.dart
diff --git a/pkg/analyzer/test/src/dart/analysis/search_test.dart b/pkg/analyzer/test/src/dart/analysis/search_test.dart
index 22434b927ec79ac3594e4c65bc3ab277830c176c..3b830fb9d240652dc1b6a0729df9973295c5be1b 100644
--- a/pkg/analyzer/test/src/dart/analysis/search_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/search_test.dart
@@ -886,6 +886,25 @@ foo<T>(T a) {
await _verifyReferences(element, expected);
}
+ test_searchSubtypes() async {
+ await _resolveTestUnit('''
+class T {}
+class A extends T {} // A
+class B = Object with T; // B
+class C implements T {} // C
+''');
+ ClassElement element = _findElement('T');
+ ClassElement a = _findElement('A');
+ ClassElement b = _findElement('B');
+ ClassElement c = _findElement('C');
+ var expected = [
+ _expectId(a, SearchResultKind.REFERENCE, 'T {} // A'),
+ _expectId(b, SearchResultKind.REFERENCE, 'T; // B'),
+ _expectId(c, SearchResultKind.REFERENCE, 'T {} // C'),
+ ];
+ await _verifyReferences(element, expected);
+ }
+
ExpectedResult _expectId(
Element enclosingElement, SearchResultKind kind, String search,
{int length, bool isResolved: true, bool isQualified: false}) {
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/search.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698