| 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.services.completion.dart.local; | 5 library test.services.completion.dart.local; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol_server.dart'; | 7 import 'package:analysis_server/src/protocol_server.dart'; |
| 8 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 8 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| 9 import 'package:analysis_server/src/services/completion/local_computer.dart'; | 9 import 'package:analysis_server/src/services/completion/local_computer.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 '''); | 142 '''); |
| 143 expect(computeFast(), isTrue); | 143 expect(computeFast(), isTrue); |
| 144 assertSuggestMethod('m', 'M2', 'void'); | 144 assertSuggestMethod('m', 'M2', 'void'); |
| 145 } | 145 } |
| 146 | 146 |
| 147 @override | 147 @override |
| 148 void setUpComputer() { | 148 void setUpComputer() { |
| 149 computer = new LocalComputer(); | 149 computer = new LocalComputer(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 test_missing_params_function() { |
| 153 addTestSource('int f1{} main(){f^}'); |
| 154 expect(computeFast(), isTrue); |
| 155 } |
| 156 |
| 157 test_missing_params_method() { |
| 158 addTestSource('class C1{int f1{} main(){f^}}'); |
| 159 expect(computeFast(), isTrue); |
| 160 } |
| 161 |
| 162 test_missing_params_constructor() { |
| 163 addTestSource('class C1{C1{} main(){C^}}'); |
| 164 expect(computeFast(), isTrue); |
| 165 } |
| 166 |
| 152 test_break_ignores_outer_functions_using_closure() { | 167 test_break_ignores_outer_functions_using_closure() { |
| 153 addTestSource(''' | 168 addTestSource(''' |
| 154 void main() { | 169 void main() { |
| 155 foo: while (true) { | 170 foo: while (true) { |
| 156 var f = () { | 171 var f = () { |
| 157 bar: while (true) { break ^ } | 172 bar: while (true) { break ^ } |
| 158 }; | 173 }; |
| 159 } | 174 } |
| 160 } | 175 } |
| 161 '''); | 176 '''); |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 expect(computeFast(), isTrue); | 764 expect(computeFast(), isTrue); |
| 750 assertSuggestMethod('m', 'B', null, relevance: DART_RELEVANCE_LOCAL_METHOD); | 765 assertSuggestMethod('m', 'B', null, relevance: DART_RELEVANCE_LOCAL_METHOD); |
| 751 } | 766 } |
| 752 | 767 |
| 753 test_shadowed_name() { | 768 test_shadowed_name() { |
| 754 addTestSource('var a; class A { var a; m() { ^ } }'); | 769 addTestSource('var a; class A { var a; m() { ^ } }'); |
| 755 expect(computeFast(), isTrue); | 770 expect(computeFast(), isTrue); |
| 756 assertSuggestLocalField('a', null); | 771 assertSuggestLocalField('a', null); |
| 757 } | 772 } |
| 758 } | 773 } |
| OLD | NEW |