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/protocol/protocol.dart'; | 9 import 'package:analysis_server/protocol/protocol.dart'; |
10 import 'package:analysis_server/protocol/protocol_generated.dart'; | 10 import 'package:analysis_server/protocol/protocol_generated.dart'; |
(...skipping 13 matching lines...) Expand all Loading... |
24 import 'mocks.dart' show pumpEventQueue; | 24 import 'mocks.dart' show pumpEventQueue; |
25 | 25 |
26 main() { | 26 main() { |
27 defineReflectiveSuite(() { | 27 defineReflectiveSuite(() { |
28 defineReflectiveTests(CompletionDomainHandlerTest); | 28 defineReflectiveTests(CompletionDomainHandlerTest); |
29 }); | 29 }); |
30 } | 30 } |
31 | 31 |
32 @reflectiveTest | 32 @reflectiveTest |
33 class CompletionDomainHandlerTest extends AbstractCompletionDomainTest { | 33 class CompletionDomainHandlerTest extends AbstractCompletionDomainTest { |
34 @override | |
35 void setUp() { | |
36 enableNewAnalysisDriver = true; | |
37 super.setUp(); | |
38 } | |
39 | |
40 test_ArgumentList_constructor_named_param_label() async { | 34 test_ArgumentList_constructor_named_param_label() async { |
41 addTestFile('main() { new A(^);}' | 35 addTestFile('main() { new A(^);}' |
42 'class A { A({one, two}) {} }'); | 36 'class A { A({one, two}) {} }'); |
43 await getSuggestions(); | 37 await getSuggestions(); |
44 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'one: ', | 38 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'one: ', |
45 relevance: DART_RELEVANCE_NAMED_PARAMETER); | 39 relevance: DART_RELEVANCE_NAMED_PARAMETER); |
46 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'two: ', | 40 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'two: ', |
47 relevance: DART_RELEVANCE_NAMED_PARAMETER); | 41 relevance: DART_RELEVANCE_NAMED_PARAMETER); |
48 expect(suggestions, hasLength(2)); | 42 expect(suggestions, hasLength(2)); |
49 } | 43 } |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 | 775 |
782 @override | 776 @override |
783 Future sort( | 777 Future sort( |
784 CompletionRequest request, Iterable<CompletionSuggestion> suggestions) { | 778 CompletionRequest request, Iterable<CompletionSuggestion> suggestions) { |
785 if (!enabled) { | 779 if (!enabled) { |
786 throw 'unexpected sort'; | 780 throw 'unexpected sort'; |
787 } | 781 } |
788 return new Future.value(); | 782 return new Future.value(); |
789 } | 783 } |
790 } | 784 } |
OLD | NEW |