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

Unified Diff: pkg/analysis_server/test/domain_completion_test.dart

Issue 901253002: move relevance computation from client to server (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix test Created 5 years, 10 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
Index: pkg/analysis_server/test/domain_completion_test.dart
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart
index ded3d0d0d5eaec51040ace78f7e2a84a94f30e51..e406bfed601fb2128fc67b9dd34f805500fe429b 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -262,8 +262,8 @@ class CompletionTest extends AbstractAnalysisTest {
}
void assertHasResult(CompletionSuggestionKind kind, String completion,
- [int relevance = COMPLETION_RELEVANCE_DEFAULT, bool isDeprecated
- = false, bool isPotential = false]) {
+ [int relevance = COMPLETION_RELEVANCE_DEFAULT, bool isDeprecated = false,
+ bool isPotential = false]) {
var cs;
suggestions.forEach((s) {
if (s.completion == completion) {
@@ -469,9 +469,18 @@ class CompletionTest extends AbstractAnalysisTest {
expect(replacementOffset, equals(completionOffset));
expect(replacementLength, equals(0));
assertHasResult(CompletionSuggestionKind.INVOCATION, 'A');
- assertHasResult(CompletionSuggestionKind.INVOCATION, 'a');
- assertHasResult(CompletionSuggestionKind.INVOCATION, 'b');
- assertHasResult(CompletionSuggestionKind.INVOCATION, 'x');
+ assertHasResult(
+ CompletionSuggestionKind.INVOCATION,
+ 'a',
+ DART_RELEVANCE_LOCAL_FIELD);
+ assertHasResult(
+ CompletionSuggestionKind.INVOCATION,
+ 'b',
+ DART_RELEVANCE_LOCAL_VARIABLE);
+ assertHasResult(
+ CompletionSuggestionKind.INVOCATION,
+ 'x',
+ DART_RELEVANCE_LOCAL_METHOD);
});
}
@@ -486,7 +495,10 @@ class CompletionTest extends AbstractAnalysisTest {
expect(replacementLength, equals(4));
// Suggestions based upon imported elements are partially filtered
//assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object');
- assertHasResult(CompletionSuggestionKind.INVOCATION, 'test');
+ assertHasResult(
+ CompletionSuggestionKind.INVOCATION,
+ 'test',
+ DART_RELEVANCE_LOCAL_TOP_LEVEL_VARIABLE);
assertNoResult('HtmlElement');
});
}

Powered by Google App Engine
This is Rietveld 408576698