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

Unified Diff: pkg/analysis_server/test/services/completion/imported_computer_test.dart

Issue 645573004: fix suggestions in class body and more common tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge 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
Index: pkg/analysis_server/test/services/completion/imported_computer_test.dart
diff --git a/pkg/analysis_server/test/services/completion/imported_computer_test.dart b/pkg/analysis_server/test/services/completion/imported_computer_test.dart
index 65373d3bfb01b7ce1a9d9d3074954da2ba4ee3fe..80b23678e0e0871dc3dccc64b8db0458816aa94a 100644
--- a/pkg/analysis_server/test/services/completion/imported_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/imported_computer_test.dart
@@ -4,7 +4,6 @@
library test.services.completion.toplevel;
-import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/completion/imported_computer.dart';
import 'package:unittest/unittest.dart';
@@ -24,106 +23,4 @@ class ImportedTypeComputerTest extends AbstractSelectorSuggestionTest {
super.setUp();
computer = new ImportedComputer();
}
-
- test_Block_function() {
- // Block BlockFunctionBody MethodDeclaration ClassDeclaration
- addSource('/testA.dart', '''
- export "dart:math" hide max;
- @deprecated A() {int x;}
- _B() {}''');
- addTestSource('''
- import "/testA.dart";
- class X {foo(){^}}''');
- return computeFull().then((_) {
- assertSuggestFunction('A', null, true);
- assertNotSuggested('x');
- assertNotSuggested('_B');
- assertSuggestFunction('min', 'num', false);
- assertSuggestFunction('max', 'num', false, CompletionRelevance.LOW);
- // Should not suggest compilation unit elements
- // which are returned by the LocalComputer
- assertNotSuggested('X');
- assertNotSuggested('foo');
- });
- }
-
- test_Block_topLevelVar() {
- // Block BlockFunctionBody MethodDeclaration
- addSource('/testA.dart', '''
- String T1;
- var _T2;''');
- addSource('/testB.dart', /* not imported */ '''
- int T3;
- var _T4;''');
- addTestSource('''
- import "/testA.dart";
- class C {foo(){^}}''');
- // pass true for full analysis to pick up unimported source
- return computeFull(true).then((_) {
- assertSuggestTopLevelVarGetterSetter('T1', 'String');
- assertNotSuggested('_T2');
- assertSuggestTopLevelVar('T3', 'int', CompletionRelevance.LOW);
- assertNotSuggested('_T4');
- // LocalComputer provides local suggestions
- assertNotSuggested('C');
- assertNotSuggested('foo');
- });
- }
-
- test_ExpressionStatement_class() {
- // SimpleIdentifier ExpressionStatement Block
- addSource('/testA.dart', '''
- _B F1() { }
- class A {int x;}
- class _B { }''');
- addTestSource('''
- import "/testA.dart";
- class C {foo(){O^}}''');
- return computeFull().then((_) {
- assertSuggestClass('A');
- assertSuggestFunction('F1', '_B', false);
- assertNotSuggested('x');
- assertNotSuggested('_B');
- // Should not suggest compilation unit elements
- // which are returned by the LocalComputer
- assertNotSuggested('C');
- });
- }
-
- test_ExpressionStatement_name() {
- // ExpressionStatement Block BlockFunctionBody MethodDeclaration
- addSource('/testA.dart', '''
- B T1;
- class B{}''');
- addTestSource('''
- import "/testA.dart";
- class C {a() {C ^}}''');
- return computeFull().then((_) {
- assertNotSuggested('T1');
- });
- }
-
- test_FieldDeclaration_name() {
- // SimpleIdentifier VariableDeclaration VariableDeclarationList
- // FieldDeclaration
- addSource('/testA.dart', 'class A { }');
- addTestSource('''
- import "/testA.dart";
- class C {A ^}''');
- return computeFull().then((_) {
- assertNotSuggested('A');
- });
- }
-
- test_FieldDeclaration_name_varType() {
- // SimpleIdentifier VariableDeclaration VariableDeclarationList
- // FieldDeclaration
- addSource('/testA.dart', 'class A { }');
- addTestSource('''
- import "/testA.dart";
- class C {var ^}''');
- return computeFull().then((_) {
- assertNotSuggested('A');
- });
- }
}

Powered by Google App Engine
This is Rietveld 408576698