| Index: pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart
|
| diff --git a/pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart b/pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart
|
| index 9e8aefa1f664bccc6288d56d5e4ae0177d433edc..89c13307217fe7caba0b07e43fcfdd25f79fa69e 100644
|
| --- a/pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart
|
| +++ b/pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart
|
| @@ -18,22 +18,6 @@ main() {
|
|
|
| @reflectiveTest
|
| class ImportUriContributorTest extends AbstractCompletionTest {
|
| - fail_import_file() {
|
| - testFile = '/proj/completion.dart';
|
| - addSource('/proj/other.dart', 'library other;');
|
| - addSource('/proj/foo/bar.dart', 'library bar;');
|
| - addSource('/blat.dart', 'library blat;');
|
| - addTestSource('import "^" import');
|
| - computeFast();
|
| - expect(request.replacementOffset, completionOffset);
|
| - expect(request.replacementLength, 0);
|
| - assertNotSuggested('completion.dart');
|
| - assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
|
| - assertSuggest('foo', csKind: CompletionSuggestionKind.IMPORT);
|
| - assertNotSuggested('foo/bar.dart');
|
| - assertNotSuggested('../blat.dart');
|
| - }
|
| -
|
| @override
|
| void setUpContributor() {
|
| contributor = new ImportUriContributor();
|
| @@ -72,6 +56,70 @@ class ImportUriContributorTest extends AbstractCompletionTest {
|
| assertSuggest('dart:math', csKind: CompletionSuggestionKind.IMPORT);
|
| }
|
|
|
| + test_import_file() {
|
| + testFile = '/proj/completion.dart';
|
| + addSource('/proj/other.dart', 'library other;');
|
| + addSource('/proj/foo/bar.dart', 'library bar;');
|
| + addSource('/blat.dart', 'library blat;');
|
| + addTestSource('import "^" import');
|
| + computeFast();
|
| + expect(request.replacementOffset, completionOffset);
|
| + expect(request.replacementLength, 0);
|
| + assertNotSuggested('completion.dart');
|
| + assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
|
| + assertSuggest('foo/', csKind: CompletionSuggestionKind.IMPORT);
|
| + assertNotSuggested('foo/bar.dart');
|
| + assertNotSuggested('../blat.dart');
|
| + }
|
| +
|
| + test_import_file2() {
|
| + testFile = '/proj/completion.dart';
|
| + addSource('/proj/other.dart', 'library other;');
|
| + addSource('/proj/foo/bar.dart', 'library bar;');
|
| + addSource('/blat.dart', 'library blat;');
|
| + addTestSource('import "..^" import');
|
| + computeFast();
|
| + expect(request.replacementOffset, completionOffset - 2);
|
| + expect(request.replacementLength, 2);
|
| + assertNotSuggested('completion.dart');
|
| + assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
|
| + assertSuggest('foo/', csKind: CompletionSuggestionKind.IMPORT);
|
| + assertNotSuggested('foo/bar.dart');
|
| + assertNotSuggested('../blat.dart');
|
| + }
|
| +
|
| + test_import_file_child() {
|
| + testFile = '/proj/completion.dart';
|
| + addSource('/proj/other.dart', 'library other;');
|
| + addSource('/proj/foo/bar.dart', 'library bar;');
|
| + addSource('/blat.dart', 'library blat;');
|
| + addTestSource('import "foo/^" import');
|
| + computeFast();
|
| + expect(request.replacementOffset, completionOffset - 4);
|
| + expect(request.replacementLength, 4);
|
| + assertNotSuggested('completion.dart');
|
| + assertNotSuggested('other.dart');
|
| + assertNotSuggested('foo');
|
| + assertSuggest('foo/bar.dart', csKind: CompletionSuggestionKind.IMPORT);
|
| + assertNotSuggested('../blat.dart');
|
| + }
|
| +
|
| + test_import_file_parent() {
|
| + testFile = '/proj/completion.dart';
|
| + addSource('/proj/other.dart', 'library other;');
|
| + addSource('/proj/foo/bar.dart', 'library bar;');
|
| + addSource('/blat.dart', 'library blat;');
|
| + addTestSource('import "../^" import');
|
| + computeFast();
|
| + expect(request.replacementOffset, completionOffset - 3);
|
| + expect(request.replacementLength, 3);
|
| + assertNotSuggested('completion.dart');
|
| + assertNotSuggested('other.dart');
|
| + assertNotSuggested('foo');
|
| + assertNotSuggested('foo/bar.dart');
|
| + assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT);
|
| + }
|
| +
|
| test_import_package() {
|
| addPackageSource('foo', 'foo.dart', 'library foo;');
|
| addPackageSource('foo', 'baz/too.dart', 'library too;');
|
|
|