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

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

Issue 1318543002: Convert completion API to be future based (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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/domain_completion.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/completion_computer_test.dart
diff --git a/pkg/analysis_server/test/services/completion/completion_computer_test.dart b/pkg/analysis_server/test/services/completion/completion_computer_test.dart
index 3e549ce9e8fec94bbd1ff07a0e506283756d4975..0cdeff95d1345abba213dfe8f826e560e21f3b05 100644
--- a/pkg/analysis_server/test/services/completion/completion_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_computer_test.dart
@@ -90,11 +90,12 @@ class DartCompletionManagerTest extends AbstractSingleUnitTest {
CompletionRequest completionRequest =
new CompletionRequestImpl(server, context, source, 0);
manager.results(completionRequest).listen((CompletionResult r) {
+ bool isLast = r is CompletionResultImpl ? r.isLast : true;
switch (++count) {
case 1:
contributor1.assertCalls(context, source, 0, searchEngine);
contributor2.assertCalls(context, source, 0, searchEngine);
- expect(r.isLast, isFalse);
+ expect(isLast, isFalse);
expect(r.suggestions, hasLength(1));
expect(r.suggestions, contains(suggestion1));
resolveLibrary();
@@ -102,7 +103,7 @@ class DartCompletionManagerTest extends AbstractSingleUnitTest {
case 2:
contributor1.assertFull(0);
contributor2.assertFull(1);
- expect(r.isLast, isTrue);
+ expect(isLast, isTrue);
expect(r.suggestions, hasLength(2));
expect(r.suggestions, contains(suggestion1));
expect(r.suggestions, contains(suggestion2));
@@ -129,11 +130,12 @@ class DartCompletionManagerTest extends AbstractSingleUnitTest {
CompletionRequest completionRequest =
new CompletionRequestImpl(server, context, source, 0);
manager.results(completionRequest).listen((CompletionResult r) {
+ bool isLast = r is CompletionResultImpl ? r.isLast : true;
switch (++count) {
case 1:
contributor1.assertCalls(context, source, 0, searchEngine);
contributor2.assertCalls(context, source, 0, searchEngine);
- expect(r.isLast, isTrue);
+ expect(isLast, isTrue);
expect(r.suggestions, hasLength(2));
expect(r.suggestions, contains(suggestion1));
expect(r.suggestions, contains(suggestion2));
« no previous file with comments | « pkg/analysis_server/lib/src/domain_completion.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698