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

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

Issue 1521753002: extract LocalConstructorContributor from local reference contributor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 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/analysis_server/test/services/completion/dart/test_all.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/services/completion/local_reference_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/local_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/local_reference_contributor_test.dart
index 1c80727f60b51eeab103861d5f883d4483533b7c..cc80c229a30c8f7357631da22f872b0f813dfa96 100644
--- a/pkg/analysis_server/test/services/completion/local_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/local_reference_contributor_test.dart
@@ -45,12 +45,6 @@ class LocalReferenceContributorTest extends AbstractSelectorSuggestionTest {
}
@override
- CompletionSuggestion assertSuggestLocalConstructor(String name,
- {int elemOffset}) {
- return assertSuggestConstructor(name, elemOffset: elemOffset);
- }
-
- @override
CompletionSuggestion assertSuggestLocalField(String name, String type,
{int relevance: DART_RELEVANCE_LOCAL_FIELD, bool deprecated: false}) {
return assertSuggestField(name, type,
@@ -643,39 +637,10 @@ class C {C.bar({boo: 'hoo', int z: 0}) { } }
main() {new ^ String x = "hello";}''');
computeFast();
return computeFull((bool result) {
- CompletionSuggestion suggestion;
-
- suggestion = assertSuggestLocalConstructor('A', elemOffset: -1);
- expect(suggestion.element.parameters, '()');
- expect(suggestion.element.returnType, 'A');
- expect(suggestion.declaringType, 'A');
- expect(suggestion.parameterNames, hasLength(0));
- expect(suggestion.requiredParameterCount, 0);
- expect(suggestion.hasNamedParameters, false);
-
- suggestion = assertSuggestLocalConstructor('B');
- expect(suggestion.element.parameters, '(int x, [String boo])');
- expect(suggestion.element.returnType, 'B');
- expect(suggestion.declaringType, 'B');
- expect(suggestion.parameterNames, hasLength(2));
- expect(suggestion.parameterNames[0], 'x');
- expect(suggestion.parameterTypes[0], 'int');
- expect(suggestion.parameterNames[1], 'boo');
- expect(suggestion.parameterTypes[1], 'String');
- expect(suggestion.requiredParameterCount, 1);
- expect(suggestion.hasNamedParameters, false);
-
- suggestion = assertSuggestLocalConstructor('C.bar');
- expect(suggestion.element.parameters, '({dynamic boo, int z})');
- expect(suggestion.element.returnType, 'C');
- expect(suggestion.declaringType, 'C');
- expect(suggestion.parameterNames, hasLength(2));
- expect(suggestion.parameterNames[0], 'boo');
- expect(suggestion.parameterTypes[0], 'dynamic');
- expect(suggestion.parameterNames[1], 'z');
- expect(suggestion.parameterTypes[1], 'int');
- expect(suggestion.requiredParameterCount, 0);
- expect(suggestion.hasNamedParameters, true);
+ // Suggested by ConstructorContributor
+ assertNotSuggested('A');
+ assertNotSuggested('B');
+ assertNotSuggested('C.bar');
});
}
« no previous file with comments | « pkg/analysis_server/test/services/completion/dart/test_all.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698