Skip to content

Commit 1473c30

Browse files
scheglovCommit Queue
authored andcommitted
Completion. Move 'allowedIdentifiers' to the top of test methods.
Change-Id: Ibed4bd2c284e3b90f1b5477a22c5559857530e51 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357981 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 6699bf7 commit 1473c30

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pkg/analysis_server/test/services/completion/dart/location/is_expression_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ suggestions
7979
}
8080

8181
Future<void> test_identifierStart() async {
82+
allowedIdentifiers = {'isFoo'};
8283
await computeSuggestions('''
8384
static void f(bool isFoo) {
8485
is^
8586
}
8687
''');
87-
allowedIdentifiers = {'isFoo'};
8888
assertResponse(r'''
8989
replacement
9090
left: 2
@@ -95,18 +95,19 @@ suggestions
9595
}
9696

9797
Future<void> test_identifierStart_notAtEndOfIs() async {
98+
allowedIdentifiers = {'isFoo'};
9899
await computeSuggestions('''
99100
static void f(bool isFoo) {
100101
is ^
101102
}
102103
''');
103-
allowedIdentifiers = {'isFoo'};
104104
assertResponse(r'''
105105
suggestions
106106
''');
107107
}
108108

109109
Future<void> test_identifierStart_staticContext() async {
110+
allowedIdentifiers = {'isF1', 'isF2'};
110111
await computeSuggestions('''
111112
class A {
112113
static bool get isF1 => false;
@@ -116,7 +117,6 @@ class A {
116117
}
117118
}
118119
''');
119-
allowedIdentifiers = {'isF1', 'isF2'};
120120
assertResponse(r'''
121121
replacement
122122
left: 2
@@ -127,12 +127,12 @@ suggestions
127127
}
128128

129129
Future<void> test_identifierStart_voidFunction() async {
130+
allowedIdentifiers = {'isFoo'};
130131
await computeSuggestions('''
131132
static void isFoo() {
132133
is^
133134
}
134135
''');
135-
allowedIdentifiers = {'isFoo'};
136136
assertResponse(r'''
137137
replacement
138138
left: 2

pkg/analysis_server/test/services/completion/dart/location/property_access_expression_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class PropertyAccessTest extends AbstractCompletionDriverTest
1717
with PropertyAccessTestCases {
1818
@failingTest
1919
Future<void> test_afterIdentifier_partial_if() async {
20+
allowedIdentifiers = {'always', 'ifPresent'};
2021
await computeSuggestions('''
2122
enum E {
2223
always, ifPresent
@@ -25,7 +26,6 @@ void f() {
2526
E.if^;
2627
}
2728
''');
28-
allowedIdentifiers = {'always', 'ifPresent'};
2929
assertResponse(r'''
3030
replacement
3131
left: 2
@@ -94,13 +94,13 @@ suggestions
9494
}
9595

9696
Future<void> test_afterIdentifier_beforeIdentifier_partial() async {
97+
allowedIdentifiers = {'length'};
9798
await computeSuggestions('''
9899
void f(String x) {
99100
x.len^
100101
foo();
101102
}
102103
''');
103-
allowedIdentifiers = {'length'};
104104
assertResponse(r'''
105105
replacement
106106
left: 3

0 commit comments

Comments
 (0)