| 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/services/completion/local_computer.dart'; | 7 import 'package:analysis_server/src/services/completion/local_computer.dart'; |
| 8 import 'package:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
| 9 | 9 |
| 10 import '../../reflective_tests.dart'; | 10 import '../../reflective_tests.dart'; |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 xtest_InstanceCreationExpression() { | 305 xtest_InstanceCreationExpression() { |
| 306 // SimpleIdentifier TypeName ConstructorName InstanceCreationExpression | 306 // SimpleIdentifier TypeName ConstructorName InstanceCreationExpression |
| 307 addTestSource('class A {a() {var f; {var x;} new ^}} class B { }'); | 307 addTestSource('class A {a() {var f; {var x;} new ^}} class B { }'); |
| 308 expect(computeFast(), isTrue); | 308 expect(computeFast(), isTrue); |
| 309 assertSuggestClass('A'); | 309 assertSuggestClass('A'); |
| 310 assertSuggestClass('B'); | 310 assertSuggestClass('B'); |
| 311 assertNotSuggested('a'); | 311 assertNotSuggested('a'); |
| 312 assertNotSuggested('f'); | 312 assertNotSuggested('f'); |
| 313 assertNotSuggested('x'); | 313 assertNotSuggested('x'); |
| 314 } | 314 } |
| 315 | |
| 316 xtest_IsExpression_imported() { | |
| 317 // SimpleIdentifier TypeName IsExpression IfStatement | |
| 318 addSource('/testB.dart', ''' | |
| 319 lib B; | |
| 320 class X {X.c(); X._d(); z() {}}'''); | |
| 321 addTestSource(''' | |
| 322 import "/testB.dart"; | |
| 323 main() {var x; if (x is ^) { }}'''); | |
| 324 return computeFull().then((_) { | |
| 325 assertNoSuggestions(); | |
| 326 }); | |
| 327 } | |
| 328 | |
| 329 xtest_IsExpression_local() { | |
| 330 // SimpleIdentifier TypeName IsExpression IfStatement | |
| 331 addTestSource(''' | |
| 332 class X {X.c(); X._d(); z() {}} | |
| 333 main() {var x; if (x is ^) { }}'''); | |
| 334 return computeFull().then((_) { | |
| 335 assertSuggestConstructor('c'); | |
| 336 assertNotSuggested('main'); | |
| 337 assertNotSuggested('X'); | |
| 338 assertNotSuggested('B'); | |
| 339 assertNotSuggested('x'); | |
| 340 }); | |
| 341 } | |
| 342 } | 315 } |
| OLD | NEW |