| Index: pkg/analysis_server/test/services/completion/keyword_computer_test.dart
|
| diff --git a/pkg/analysis_server/test/services/completion/keyword_computer_test.dart b/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
|
| index 88527fd01774f2065e375cdcddf241038bf5644e..89901541a02c8c82ed5ba01f7e2302118aac6989 100644
|
| --- a/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
|
| +++ b/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
|
| @@ -36,10 +36,29 @@ class KeywordComputerTest extends AbstractCompletionTest {
|
| computer = new KeywordComputer();
|
| }
|
|
|
| - test_class_extends() {
|
| + test_after_class() {
|
| + addTestSource('class A {} ^');
|
| + expect(computeFast(), isTrue);
|
| + assertSuggestKeywords(
|
| + ['abstract', 'class', 'const', 'final', 'typedef', 'var']);
|
| + }
|
| +
|
| + test_before_import() {
|
| + addTestSource('^ import foo;');
|
| + expect(computeFast(), isTrue);
|
| + assertSuggestKeywords(['export', 'import', 'library', 'part']);
|
| + }
|
| +
|
| + test_class() {
|
| addTestSource('class A ^');
|
| expect(computeFast(), isTrue);
|
| - assertSuggestKeywords(['extends', 'implements', 'with']);
|
| + assertSuggestKeywords(['extends', 'implements']);
|
| + }
|
| +
|
| + test_class_extends() {
|
| + addTestSource('class A extends foo ^');
|
| + expect(computeFast(), isTrue);
|
| + assertSuggestKeywords(['implements', 'with']);
|
| }
|
|
|
| test_class_extends_name() {
|
| @@ -48,12 +67,30 @@ class KeywordComputerTest extends AbstractCompletionTest {
|
| assertSuggestKeywords([]);
|
| }
|
|
|
| + test_class_implements() {
|
| + addTestSource('class A ^ implements foo');
|
| + expect(computeFast(), isTrue);
|
| + assertSuggestKeywords(['extends']);
|
| + }
|
| +
|
| + test_class_implements_name() {
|
| + addTestSource('class A implements ^');
|
| + expect(computeFast(), isTrue);
|
| + assertSuggestKeywords([]);
|
| + }
|
| +
|
| test_class_name() {
|
| addTestSource('class ^');
|
| expect(computeFast(), isTrue);
|
| assertSuggestKeywords([]);
|
| }
|
|
|
| + test_class_with_name() {
|
| + addTestSource('class A extends foo with ^');
|
| + expect(computeFast(), isTrue);
|
| + assertSuggestKeywords([]);
|
| + }
|
| +
|
| test_empty() {
|
| addTestSource('^');
|
| expect(computeFast(), isTrue);
|
| @@ -70,4 +107,42 @@ class KeywordComputerTest extends AbstractCompletionTest {
|
| 'typedef',
|
| 'var']);
|
| }
|
| +
|
| + test_library() {
|
| + addTestSource('library foo;^');
|
| + expect(computeFast(), isTrue);
|
| + assertSuggestKeywords(
|
| + [
|
| + 'abstract',
|
| + 'class',
|
| + 'const',
|
| + 'export',
|
| + 'final',
|
| + 'import',
|
| + 'part',
|
| + 'typedef',
|
| + 'var']);
|
| + }
|
| +
|
| + test_library_name() {
|
| + addTestSource('library ^');
|
| + expect(computeFast(), isTrue);
|
| + assertSuggestKeywords([]);
|
| + }
|
| +
|
| + test_part_of() {
|
| + addTestSource('part of foo;^');
|
| + expect(computeFast(), isTrue);
|
| + assertSuggestKeywords(
|
| + [
|
| + 'abstract',
|
| + 'class',
|
| + 'const',
|
| + 'export',
|
| + 'final',
|
| + 'import',
|
| + 'part',
|
| + 'typedef',
|
| + 'var']);
|
| + }
|
| }
|
|
|