| 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.invocation; | 5 library test.services.completion.invocation; |
| 6 | 6 |
| 7 | 7 |
| 8 import 'package:analysis_server/src/protocol.dart'; | 8 import 'package:analysis_server/src/protocol.dart'; |
| 9 import 'package:analysis_server/src/services/completion/invocation_computer.dart
'; | 9 import 'package:analysis_server/src/services/completion/invocation_computer.dart
'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| 11 | 11 |
| 12 import '../../reflective_tests.dart'; | 12 import '../../reflective_tests.dart'; |
| 13 import 'completion_test_util.dart'; | 13 import 'completion_test_util.dart'; |
| 14 | 14 |
| 15 main() { | 15 main() { |
| 16 groupSep = ' | '; | 16 groupSep = ' | '; |
| 17 runReflectiveTests(InvocationComputerTest); | 17 runReflectiveTests(InvocationComputerTest); |
| 18 } | 18 } |
| 19 | 19 |
| 20 @ReflectiveTestCase() | 20 @ReflectiveTestCase() |
| 21 class InvocationComputerTest extends AbstractSelectorSuggestionTest { | 21 class InvocationComputerTest extends AbstractSelectorSuggestionTest { |
| 22 | 22 |
| 23 @override | 23 @override |
| 24 void setUp() { | 24 void setUp() { |
| 25 super.setUp(); | 25 super.setUp(); |
| 26 computer = new InvocationComputer(); | 26 computer = new InvocationComputer(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 test_CascadeExpression_target() { | |
| 30 // PropertyAccess CascadeExpression ExpressionStatement | |
| 31 addTestSource(''' | |
| 32 class A {var b; X _c;} | |
| 33 class X{} | |
| 34 main() {A a; a^..b}'''); | |
| 35 return computeFull().then((_) { | |
| 36 assertNotSuggested('b'); | |
| 37 assertNotSuggested('_c'); | |
| 38 }); | |
| 39 } | |
| 40 | |
| 41 test_ConstructorName_importedClass() { | 29 test_ConstructorName_importedClass() { |
| 42 // SimpleIdentifier PrefixedIdentifier TypeName ConstructorName | 30 // SimpleIdentifier PrefixedIdentifier TypeName ConstructorName |
| 43 // InstanceCreationExpression | 31 // InstanceCreationExpression |
| 44 addSource('/testB.dart', ''' | 32 addSource('/testB.dart', ''' |
| 45 lib B; | 33 lib B; |
| 46 class X {X.c(); X._d(); z() {}}'''); | 34 class X {X.c(); X._d(); z() {}}'''); |
| 47 addTestSource(''' | 35 addTestSource(''' |
| 48 import "/testB.dart"; | 36 import "/testB.dart"; |
| 49 var m; | 37 var m; |
| 50 main() {new X.^}'''); | 38 main() {new X.^}'''); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 class X {set y(X x) {} set _z(X x) {}}'''); | 244 class X {set y(X x) {} set _z(X x) {}}'''); |
| 257 addTestSource(''' | 245 addTestSource(''' |
| 258 import "/testB.dart"; | 246 import "/testB.dart"; |
| 259 main() {X x; x.^}'''); | 247 main() {X x; x.^}'''); |
| 260 return computeFull().then((_) { | 248 return computeFull().then((_) { |
| 261 assertSuggestSetter('y'); | 249 assertSuggestSetter('y'); |
| 262 assertNotSuggested('_z'); | 250 assertNotSuggested('_z'); |
| 263 }); | 251 }); |
| 264 } | 252 } |
| 265 } | 253 } |
| OLD | NEW |