| 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_services/src/completion/local_computer.dart'; | 7 import 'package:analysis_services/src/completion/local_computer.dart'; |
| 8 import 'package:analysis_testing/reflective_tests.dart'; | 8 import 'package:analysis_testing/reflective_tests.dart'; |
| 9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 assertSuggestVariable('i'); | 65 assertSuggestVariable('i'); |
| 66 } | 66 } |
| 67 | 67 |
| 68 test_forEach() { | 68 test_forEach() { |
| 69 addTestSource('main(args) {for (foo in bar) {^}}'); | 69 addTestSource('main(args) {for (foo in bar) {^}}'); |
| 70 expect(computeFast(), isTrue); | 70 expect(computeFast(), isTrue); |
| 71 assertSuggestVariable('foo'); | 71 assertSuggestVariable('foo'); |
| 72 } | 72 } |
| 73 | 73 |
| 74 test_function() { | 74 test_function() { |
| 75 addTestSource('main(args) {^}'); | 75 addTestSource('main(args) {x.then((b) {^});}'); |
| 76 expect(computeFast(), isTrue); | 76 expect(computeFast(), isTrue); |
| 77 assertSuggestFunction('main'); | 77 assertSuggestFunction('main'); |
| 78 assertSuggestParameter('args'); | 78 assertSuggestParameter('args'); |
| 79 assertSuggestParameter('b'); |
| 79 } | 80 } |
| 80 | 81 |
| 81 test_members() { | 82 test_members() { |
| 82 addTestSource('class A {var f; a() {^} var g;}'); | 83 addTestSource('class A {var f; a() {^} var g;}'); |
| 83 expect(computeFast(), isTrue); | 84 expect(computeFast(), isTrue); |
| 84 assertSuggestMethodName('a'); | 85 assertSuggestMethodName('a'); |
| 85 assertSuggestField('f'); | 86 assertSuggestField('f'); |
| 86 assertSuggestField('g'); | 87 assertSuggestField('g'); |
| 87 } | 88 } |
| 88 | 89 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 103 } | 104 } |
| 104 | 105 |
| 105 test_variableDeclaration() { | 106 test_variableDeclaration() { |
| 106 addTestSource('main() {int a = 1, b = 2 + ^;}'); | 107 addTestSource('main() {int a = 1, b = 2 + ^;}'); |
| 107 expect(computeFast(), isTrue); | 108 expect(computeFast(), isTrue); |
| 108 assertSuggestVariable('a'); | 109 assertSuggestVariable('a'); |
| 109 assertNotSuggested('b'); | 110 assertNotSuggested('b'); |
| 110 } | 111 } |
| 111 } | 112 } |
| 112 | 113 |
| OLD | NEW |