Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart

Issue 1118143004: suggest part file uris (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 89c13307217fe7caba0b07e43fcfdd25f79fa69e..8997bf2190a2288cff7429db378c2bcfda66e7b7 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
@@ -164,4 +164,68 @@ class ImportUriContributorTest extends AbstractCompletionTest {
assertNoSuggestions();
});
}
+
+ test_part_file() {
+ testFile = '/proj/completion.dart';
+ addSource('/proj/other.dart', 'library other;');
+ addSource('/proj/foo/bar.dart', 'library bar;');
+ addSource('/blat.dart', 'library blat;');
+ addTestSource('library x; part "^" 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_part_file2() {
+ testFile = '/proj/completion.dart';
+ addSource('/proj/other.dart', 'library other;');
+ addSource('/proj/foo/bar.dart', 'library bar;');
+ addSource('/blat.dart', 'library blat;');
+ addTestSource('library x; part "..^" 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_part_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('library x; part "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_part_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('library x; part "../^" 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);
+ }
}
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698