| Index: pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
|
| diff --git a/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
|
| index f892bb19be24c74911f780e3712361a72307c9bd..8e72635c53cb398b1ceec61dcc88823293afe3cc 100644
|
| --- a/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
|
| +++ b/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
|
| @@ -2324,6 +2324,39 @@ class A {a(^) { }}''');
|
| assertNotSuggested('bar');
|
| }
|
|
|
| + test_ForEachStatement() async {
|
| + // SimpleIdentifier ForEachStatement
|
| + addTestSource('main() {List<int> values; for (int index in ^)}');
|
| + await computeSuggestions();
|
| +
|
| + expect(replacementOffset, completionOffset);
|
| + expect(replacementLength, 0);
|
| + assertSuggestLocalVariable('values', 'List');
|
| + assertNotSuggested('index');
|
| + }
|
| +
|
| + test_ForEachStatement2() async {
|
| + // SimpleIdentifier ForEachStatement
|
| + addTestSource('main() {List<int> values; for (int index in i^)}');
|
| + await computeSuggestions();
|
| +
|
| + expect(replacementOffset, completionOffset - 1);
|
| + expect(replacementLength, 1);
|
| + assertSuggestLocalVariable('values', 'List');
|
| + assertNotSuggested('index');
|
| + }
|
| +
|
| + test_ForEachStatement3() async {
|
| + // SimpleIdentifier ParenthesizedExpression ForEachStatement
|
| + addTestSource('main() {List<int> values; for (int index in (i^))}');
|
| + await computeSuggestions();
|
| +
|
| + expect(replacementOffset, completionOffset - 1);
|
| + expect(replacementLength, 1);
|
| + assertSuggestLocalVariable('values', 'List');
|
| + assertNotSuggested('index');
|
| + }
|
| +
|
| test_ForStatement_body() async {
|
| // Block ForStatement
|
| addTestSource('main(args) {for (int i; i < 10; ++i) {^}}');
|
|
|