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

Unified Diff: pkg/analysis_services/test/completion/imported_type_computer_test.dart

Issue 465843002: respect show/hide combinators when generating suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comments Created 6 years, 4 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_services/test/completion/completion_test_util.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_services/test/completion/imported_type_computer_test.dart
diff --git a/pkg/analysis_services/test/completion/imported_type_computer_test.dart b/pkg/analysis_services/test/completion/imported_type_computer_test.dart
index 869dfc8c95a19bba8a33485315743edf58208b4e..a6361f6437402462aadfaeadda001088403e1a3e 100644
--- a/pkg/analysis_services/test/completion/imported_type_computer_test.dart
+++ b/pkg/analysis_services/test/completion/imported_type_computer_test.dart
@@ -38,6 +38,50 @@ class ImportedTypeComputerTest extends AbstractCompletionTest {
});
}
+ test_class_importHide() {
+ addSource('/testA.dart', 'class A { } class B { }');
+ addTestSource('import "/testA.dart" hide ^; class C {}');
+ return computeFull().then((_) {
+ assertSuggestClass('A');
+ assertSuggestClass('B');
+ assertNotSuggested('Object');
+ });
+ }
+
+ test_class_importShow() {
+ addSource('/testA.dart', 'class A { } class B { }');
+ addTestSource('import "/testA.dart" show ^; class C {}');
+ return computeFull().then((_) {
+ // only suggest elements listed in show combinator
+ assertSuggestClass('A');
+ assertSuggestClass('B');
+ assertNotSuggested('Object');
+ });
+ }
+
+ test_class_importShowWithPart() {
+ addSource('/testB.dart', 'part of libA; class B { }');
+ addSource('/testA.dart', 'part "/testB.dart"; class A { }');
+ addTestSource('import "/testA.dart" show ^; class C {}');
+ return computeFull().then((_) {
+ // only suggest elements listed in show combinator
+ assertSuggestClass('A');
+ assertSuggestClass('B');
+ assertNotSuggested('Object');
+ });
+ }
+
+ test_class_importedWithHide() {
+ addSource('/testA.dart', 'class A { } class B { }');
+ addTestSource('import "/testA.dart" hide B; class C {foo(){^}}');
+ return computeFull().then((_) {
+ // exclude elements listed in hide combinator
+ assertSuggestClass('A');
+ assertNotSuggested('B');
+ assertSuggestClass('Object');
+ });
+ }
+
test_class_importedWithPrefix() {
addSource('/testA.dart', 'class A { }');
addTestSource('import "/testA.dart" as foo; class C {foo(){^}}');
@@ -49,6 +93,17 @@ class ImportedTypeComputerTest extends AbstractCompletionTest {
});
}
+ test_class_importedWithShow() {
+ addSource('/testA.dart', 'class A { } class B { }');
+ addTestSource('import "/testA.dart" show A; class C {foo(){^}}');
+ return computeFull().then((_) {
+ // only suggest elements listed in show combinator
+ assertSuggestClass('A');
+ assertNotSuggested('B');
+ assertSuggestClass('Object');
+ });
+ }
+
test_class_notImported() {
addSource('/testA.dart', 'class A {int x;} class _B { }');
addTestSource('class C {foo(){^}}');
« no previous file with comments | « pkg/analysis_services/test/completion/completion_test_util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698