OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library test.domain.completion; | 5 library test.domain.completion; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
10 import 'package:analysis_server/src/domain_completion.dart'; | 10 import 'package:analysis_server/src/domain_completion.dart'; |
11 import 'package:analysis_server/src/provisional/completion/completion_core.dart'
; | 11 import 'package:analysis_server/src/provisional/completion/completion_core.dart'
; |
12 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; | 12 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; |
13 import 'package:analysis_server/src/services/completion/dart/completion_manager.
dart'; | 13 import 'package:analysis_server/src/services/completion/dart/completion_manager.
dart'; |
14 import 'package:analysis_server/src/services/completion/dart/contribution_sorter
.dart'; | 14 import 'package:analysis_server/src/services/completion/dart/contribution_sorter
.dart'; |
15 import 'package:test/test.dart'; | 15 import 'package:test/test.dart'; |
16 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 16 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
17 | 17 |
18 import 'analysis_abstract.dart'; | 18 import 'analysis_abstract.dart'; |
19 import 'domain_completion_util.dart'; | 19 import 'domain_completion_util.dart'; |
20 import 'mocks.dart' show pumpEventQueue; | 20 import 'mocks.dart' show pumpEventQueue; |
21 import 'utils.dart'; | |
22 | 21 |
23 main() { | 22 main() { |
24 initializeTestEnvironment(); | |
25 defineReflectiveSuite(() { | 23 defineReflectiveSuite(() { |
26 defineReflectiveTests(CompletionDomainHandlerTest); | 24 defineReflectiveTests(CompletionDomainHandlerTest); |
27 defineReflectiveTests(_NoSearchEngine); | 25 defineReflectiveTests(_NoSearchEngine); |
28 }); | 26 }); |
29 } | 27 } |
30 | 28 |
31 @reflectiveTest | 29 @reflectiveTest |
32 class CompletionDomainHandlerTest extends AbstractCompletionDomainTest { | 30 class CompletionDomainHandlerTest extends AbstractCompletionDomainTest { |
33 test_ArgumentList_imported_function_named_param() async { | 31 test_ArgumentList_imported_function_named_param() async { |
34 addTestFile('main() { int.parse("16", ^);}'); | 32 addTestFile('main() { int.parse("16", ^);}'); |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 } | 606 } |
609 '''); | 607 '''); |
610 await waitForTasksFinished(); | 608 await waitForTasksFinished(); |
611 Request request = | 609 Request request = |
612 new CompletionGetSuggestionsParams(testFile, 0).toRequest('0'); | 610 new CompletionGetSuggestionsParams(testFile, 0).toRequest('0'); |
613 Response response = handler.handleRequest(request); | 611 Response response = handler.handleRequest(request); |
614 expect(response.error, isNotNull); | 612 expect(response.error, isNotNull); |
615 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); | 613 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); |
616 } | 614 } |
617 } | 615 } |
OLD | NEW |