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

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

Issue 582453002: Index and search of import prefixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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: pkg/analysis_server/test/search/element_references_test.dart
diff --git a/pkg/analysis_server/test/search/element_references_test.dart b/pkg/analysis_server/test/search/element_references_test.dart
index 7377c2c83552158d5cd6d76ffb169c6e593a77d6..f5c3f15c19b8bff97972007ab461ff9761fb86ff 100644
--- a/pkg/analysis_server/test/search/element_references_test.dart
+++ b/pkg/analysis_server/test/search/element_references_test.dart
@@ -297,6 +297,25 @@ main(A a, B b, C c) {
});
}
+ test_prefix() {
+ addTestFile('''
+import 'dart:async' as ppp;
+main() {
+ ppp.Future a;
+ ppp.Stream b;
+}
+''');
+ return findElementReferences("ppp;", false).then((_) {
+ expect(searchElement.kind, ElementKind.PREFIX);
+ expect(searchElement.name, 'ppp');
+ expect(searchElement.location.startLine, 1);
+ expect(results, hasLength(3));
+ assertHasResult(SearchResultKind.DECLARATION, 'ppp;');
+ assertHasResult(SearchResultKind.REFERENCE, 'ppp.Future');
+ assertHasResult(SearchResultKind.REFERENCE, 'ppp.Stream');
+ });
+ }
+
test_label() {
addTestFile('''
main() {

Powered by Google App Engine
This is Rietveld 408576698