| Index: pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| diff --git a/pkg/analysis_server/test/services/completion/completion_test_util.dart b/pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| index 53a329c0fe487df8f42910f2b00aad182a463fb5..412d92a1957f927266cd163c6c15648706a5f406 100644
|
| --- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| +++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| @@ -492,9 +492,8 @@ abstract class AbstractCompletionTest extends AbstractContextTest {
|
| cache,
|
| [computer]);
|
| var result = _completionManager.computeFast(request);
|
| - if (request.replacementOffset == null) {
|
| - fail('expected non null');
|
| - }
|
| + expect(request.replacementOffset, isNotNull);
|
| + expect(request.replacementLength, isNotNull);
|
| return result.isEmpty;
|
| }
|
|
|
| @@ -2137,6 +2136,35 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
|
| });
|
| }
|
|
|
| + test_keyword() {
|
| + addSource('/testB.dart', '''
|
| + lib B;
|
| + int newT1;
|
| + int T1;
|
| + nowIsIt() { }
|
| + class X {factory X.c(); factory X._d(); z() {}}''');
|
| + addTestSource('''
|
| + import "/testB.dart";
|
| + String newer() {}
|
| + var m;
|
| + main() {new^ X.c();}''');
|
| + computeFast();
|
| + return computeFull((bool result) {
|
| + expect(request.replacementOffset, completionOffset - 3);
|
| + expect(request.replacementLength, 3);
|
| + assertNotSuggested('c');
|
| + assertNotSuggested('_d');
|
| + // Imported suggestion are filtered by 1st character
|
| + assertSuggestImportedFunction('nowIsIt', null);
|
| + assertNotSuggested('T1');
|
| + // TODO (danrubel) this really should be TopLevelVar not getter/setter
|
| + assertSuggestTopLevelVarGetterSetter('newT1', 'int');
|
| + assertNotSuggested('z');
|
| + assertSuggestLocalTopLevelVar('m', 'dynamic');
|
| + assertSuggestLocalFunction('newer', 'String');
|
| + });
|
| + }
|
| +
|
| test_Literal_string() {
|
| // SimpleStringLiteral ExpressionStatement Block
|
| addTestSource('class A {a() {"hel^lo"}}');
|
|
|