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

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

Issue 640333002: Improve import prefix search results UI. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/analysis_server/lib/src/search/search_domain.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/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 f5c3f15c19b8bff97972007ab461ff9761fb86ff..8c67fc9555d333ebba71378ab01756b9e25254ff 100644
--- a/pkg/analysis_server/test/search/element_references_test.dart
+++ b/pkg/analysis_server/test/search/element_references_test.dart
@@ -297,25 +297,6 @@ 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() {
@@ -635,6 +616,38 @@ globalFunction(Base b) {
});
}
+ 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_prefix_null() {
+ addTestFile('''
+import 'dart:async';
+main() {
+ Future a;
+ Stream b;
+}
+''');
+ return findElementReferences("import ", false).then((_) {
+ expect(searchElement, isNull);
+ });
+ }
+
test_topLevelVariable_explicit() {
addTestFile('''
var vvv = 1;
« no previous file with comments | « pkg/analysis_server/lib/src/search/search_domain.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698