| Index: pkg/analysis_server/test/services/completion/dart/uri_contributor_test.dart
|
| diff --git a/pkg/analysis_server/test/services/completion/dart/uri_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/uri_contributor_test.dart
|
| index 7fae478401453e5d5b3b4906e63f3d9fc348781b..008498450d63596f2993d26fa8eefe10aa9e7027 100644
|
| --- a/pkg/analysis_server/test/services/completion/dart/uri_contributor_test.dart
|
| +++ b/pkg/analysis_server/test/services/completion/dart/uri_contributor_test.dart
|
| @@ -76,6 +76,20 @@ class UriContributorTest extends DartCompletionContributorTest {
|
| csKind: CompletionSuggestionKind.IMPORT);
|
| }
|
|
|
| + test_export_package2_off() async {
|
| + try {
|
| + UriContributor.suggestFilePaths = false;
|
| + addPackageSource('foo', 'foo.dart', 'library foo;');
|
| + addPackageSource('foo', 'baz/too.dart', 'library too;');
|
| + addPackageSource('bar', 'bar.dart', 'library bar;');
|
| + addTestSource('export "package:foo/baz/^" import');
|
| + await computeSuggestions();
|
| + assertNotSuggested('package:foo/baz/too.dart');
|
| + } finally {
|
| + UriContributor.suggestFilePaths = true;
|
| + }
|
| + }
|
| +
|
| test_import() async {
|
| addTestSource('import "^"');
|
| await computeSuggestions();
|
| @@ -163,6 +177,28 @@ class UriContributorTest extends DartCompletionContributorTest {
|
| assertNotSuggested('../blat.dart');
|
| }
|
|
|
| + test_import_file2_off() async {
|
| + try {
|
| + UriContributor.suggestFilePaths = false;
|
| + 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');
|
| + await computeSuggestions();
|
| + expect(replacementOffset, completionOffset - 2);
|
| + expect(replacementLength, 2);
|
| + assertNotSuggested('completion.dart');
|
| + assertNotSuggested('other.dart');
|
| + assertNotSuggested('foo');
|
| + assertNotSuggested('foo/');
|
| + assertNotSuggested('foo/bar.dart');
|
| + assertNotSuggested('../blat.dart');
|
| + } finally {
|
| + UriContributor.suggestFilePaths = true;
|
| + }
|
| + }
|
| +
|
| test_import_file_child() async {
|
| testFile = '/proj/completion.dart';
|
| addSource('/proj/other.dart', 'library other;');
|
| @@ -265,6 +301,20 @@ class UriContributorTest extends DartCompletionContributorTest {
|
| csKind: CompletionSuggestionKind.IMPORT);
|
| }
|
|
|
| + test_import_package2_off() async {
|
| + try {
|
| + UriContributor.suggestFilePaths = false;
|
| + addPackageSource('foo', 'foo.dart', 'library foo;');
|
| + addPackageSource('foo', 'baz/too.dart', 'library too;');
|
| + addPackageSource('bar', 'bar.dart', 'library bar;');
|
| + addTestSource('import "package:foo/baz/^" import');
|
| + await computeSuggestions();
|
| + assertNotSuggested('package:foo/baz/too.dart');
|
| + } finally {
|
| + UriContributor.suggestFilePaths = true;
|
| + }
|
| + }
|
| +
|
| test_import_package2_raw() async {
|
| addPackageSource('foo', 'foo.dart', 'library foo;');
|
| addPackageSource('foo', 'baz/too.dart', 'library too;');
|
|
|