| 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.util; | 5 library test.services.completion.util; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart' as protocol | 9 import 'package:analysis_server/src/protocol.dart' as protocol |
| 10 show Element, ElementKind; | 10 show Element, ElementKind; |
| (...skipping 3480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3491 expect(request.replacementOffset, completionOffset - 2); | 3491 expect(request.replacementOffset, completionOffset - 2); |
| 3492 expect(request.replacementLength, 8); | 3492 expect(request.replacementLength, 8); |
| 3493 assertSuggestInvocationGetter('length', 'int'); | 3493 assertSuggestInvocationGetter('length', 'int'); |
| 3494 assertNotSuggested('A'); | 3494 assertNotSuggested('A'); |
| 3495 assertNotSuggested('a'); | 3495 assertNotSuggested('a'); |
| 3496 assertNotSuggested('Object'); | 3496 assertNotSuggested('Object'); |
| 3497 assertNotSuggested('=='); | 3497 assertNotSuggested('=='); |
| 3498 }); | 3498 }); |
| 3499 } | 3499 } |
| 3500 | 3500 |
| 3501 test_PropertyAccess_noTarget() { |
| 3502 // SimpleIdentifier PropertyAccess ExpressionStatement |
| 3503 addSource('/testAB.dart', 'class Foo { }'); |
| 3504 addTestSource('class C {foo(){.^}}'); |
| 3505 computeFast(); |
| 3506 return computeFull((bool result) { |
| 3507 assertNoSuggestions(); |
| 3508 }); |
| 3509 } |
| 3510 |
| 3511 test_PropertyAccess_noTarget2() { |
| 3512 // SimpleIdentifier PropertyAccess ExpressionStatement |
| 3513 addSource('/testAB.dart', 'class Foo { }'); |
| 3514 addTestSource('main() {.^}'); |
| 3515 computeFast(); |
| 3516 return computeFull((bool result) { |
| 3517 assertNoSuggestions(); |
| 3518 }); |
| 3519 } |
| 3520 |
| 3501 test_PropertyAccess_selector() { | 3521 test_PropertyAccess_selector() { |
| 3502 // SimpleIdentifier PropertyAccess ExpressionStatement Block | 3522 // SimpleIdentifier PropertyAccess ExpressionStatement Block |
| 3503 addTestSource('class A {a() {"hello".length.^}}'); | 3523 addTestSource('class A {a() {"hello".length.^}}'); |
| 3504 computeFast(); | 3524 computeFast(); |
| 3505 return computeFull((bool result) { | 3525 return computeFull((bool result) { |
| 3506 expect(request.replacementOffset, completionOffset); | 3526 expect(request.replacementOffset, completionOffset); |
| 3507 expect(request.replacementLength, 0); | 3527 expect(request.replacementLength, 0); |
| 3508 assertSuggestInvocationGetter('isEven', 'bool'); | 3528 assertSuggestInvocationGetter('isEven', 'bool'); |
| 3509 assertNotSuggested('A'); | 3529 assertNotSuggested('A'); |
| 3510 assertNotSuggested('a'); | 3530 assertNotSuggested('a'); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3737 assertNotSuggested('bar2'); | 3757 assertNotSuggested('bar2'); |
| 3738 assertNotSuggested('_B'); | 3758 assertNotSuggested('_B'); |
| 3739 assertSuggestLocalClass('Y'); | 3759 assertSuggestLocalClass('Y'); |
| 3740 assertSuggestLocalClass('C'); | 3760 assertSuggestLocalClass('C'); |
| 3741 assertSuggestLocalVariable('f', null); | 3761 assertSuggestLocalVariable('f', null); |
| 3742 assertNotSuggested('x'); | 3762 assertNotSuggested('x'); |
| 3743 assertNotSuggested('e'); | 3763 assertNotSuggested('e'); |
| 3744 }); | 3764 }); |
| 3745 } | 3765 } |
| 3746 } | 3766 } |
| OLD | NEW |