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

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

Issue 1860213002: Fix for issue 24555: import/export/part completion improvement. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Comment from DanR Created 4 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/test/domain_completion_test.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/dart/keyword_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart
index 73642ea431a600340bb9ba08d72cd2c6cfc713b8..2e7e48b8e0c7df6c3bf1e11955df41ed59d14e5d 100644
--- a/pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart
@@ -220,6 +220,13 @@ class KeywordContributorTest extends DartCompletionContributorTest {
Map<String, int> expectedOffsets = <String, int>{};
Set<String> actualCompletions = new Set<String>();
expectedCompletions.addAll(expectedKeywords.map((k) => k.syntax));
+ ['import', 'export', 'part'].forEach((s) {
+ if (expectedCompletions.contains(s)) {
+ expectedCompletions.remove(s);
+ expectedCompletions.add('$s \'\';');
+ }
+ });
+
expectedCompletions.addAll(pseudoKeywords);
for (CompletionSuggestion s in suggestions) {
if (s.kind == CompletionSuggestionKind.KEYWORD) {
@@ -245,10 +252,6 @@ class KeywordContributorTest extends DartCompletionContributorTest {
if (s.kind == CompletionSuggestionKind.KEYWORD) {
if (s.completion.startsWith(Keyword.IMPORT.syntax)) {
int importRelevance = relevance;
- if (importRelevance == DART_RELEVANCE_HIGH &&
- s.completion == "import '';") {
- ++importRelevance;
- }
expect(s.relevance, equals(importRelevance), reason: s.completion);
} else {
if (s.completion == Keyword.RETHROW.syntax) {
@@ -261,7 +264,11 @@ class KeywordContributorTest extends DartCompletionContributorTest {
if (expectedOffset == null) {
expectedOffset = s.completion.length;
}
- expect(s.selectionOffset, equals(expectedOffset));
+ expect(
+ s.selectionOffset,
+ equals(s.completion.endsWith('\'\';')
+ ? expectedOffset - 2
+ : expectedOffset));
expect(s.selectionLength, equals(0));
expect(s.isDeprecated, equals(false));
expect(s.isPotential, equals(false));
« no previous file with comments | « pkg/analysis_server/test/domain_completion_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698