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

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

Issue 1054363003: replace request.node with request.target (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 9 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/services/completion/completion_test_util.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/keyword_computer_test.dart
diff --git a/pkg/analysis_server/test/services/completion/keyword_computer_test.dart b/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
index e044d9f55d4c16cca6d08de846e5202e51f79444..51610100e63844c5405c7de16658451f4ddc1b5d 100644
--- a/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
@@ -63,7 +63,7 @@ class KeywordComputerTest extends AbstractCompletionTest {
void assertSuggestKeywords(Iterable<Keyword> expectedKeywords,
[int relevance = DART_RELEVANCE_KEYWORD]) {
Set<Keyword> actualKeywords = new Set<Keyword>();
- request.suggestions.forEach((CompletionSuggestion s) {
+ for (CompletionSuggestion s in request.suggestions) {
if (s.kind == CompletionSuggestionKind.KEYWORD) {
Keyword k = Keyword.keywords[s.completion];
if (k == null) {
@@ -73,13 +73,8 @@ class KeywordComputerTest extends AbstractCompletionTest {
fail('Duplicate keyword suggested: ${s.completion}');
}
}
- expect(s.relevance, equals(relevance), reason: k.toString());
- expect(s.selectionOffset, equals(s.completion.length));
- expect(s.selectionLength, equals(0));
- expect(s.isDeprecated, equals(false));
- expect(s.isPotential, equals(false));
}
- });
+ };
if (expectedKeywords.any((k) => k is String)) {
StringBuffer msg = new StringBuffer();
msg.writeln('Expected set should be:');
@@ -97,6 +92,16 @@ class KeywordComputerTest extends AbstractCompletionTest {
_appendKeywords(msg, actualKeywords);
fail(msg.toString());
}
+ for (CompletionSuggestion s in request.suggestions) {
+ if (s.kind == CompletionSuggestionKind.KEYWORD) {
+ Keyword k = Keyword.keywords[s.completion];
+ expect(s.relevance, equals(relevance), reason: k.toString());
+ expect(s.selectionOffset, equals(s.completion.length));
+ expect(s.selectionLength, equals(0));
+ expect(s.isDeprecated, equals(false));
+ expect(s.isPotential, equals(false));
+ }
+ };
}
@override
@@ -173,21 +178,7 @@ class KeywordComputerTest extends AbstractCompletionTest {
], DART_RELEVANCE_HIGH);
}
- test_class() {
- addTestSource('class A ^');
- expect(computeFast(), isTrue);
- assertSuggestKeywords(
- [Keyword.EXTENDS, Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
- }
-
- test_class2() {
- addTestSource('class A e^');
- expect(computeFast(), isTrue);
- assertSuggestKeywords(
- [Keyword.EXTENDS, Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
- }
-
- test_class3() {
+ test_class4() {
addTestSource('class A e^ { }');
expect(computeFast(), isTrue);
assertSuggestKeywords(
@@ -255,6 +246,27 @@ class KeywordComputerTest extends AbstractCompletionTest {
assertSuggestKeywords([]);
}
+ test_class_noBody() {
+ addTestSource('class A ^');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(
+ [Keyword.EXTENDS, Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
+ }
+
+ test_class_noBody2() {
+ addTestSource('class A e^');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(
+ [Keyword.EXTENDS, Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
+ }
+
+ test_class_noBody3() {
+ addTestSource('class A e^ String foo;');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(
+ [Keyword.EXTENDS, Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
+ }
+
test_class_with() {
addTestSource('class A extends foo with bar ^');
expect(computeFast(), isTrue);
« no previous file with comments | « pkg/analysis_server/test/services/completion/completion_test_util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698