| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 ' class _B {}' // | 75 ' class _B {}' // |
| 76 ' A T;'); | 76 ' A T;'); |
| 77 expect(computeFast(), isTrue); | 77 expect(computeFast(), isTrue); |
| 78 var a = assertSuggestClass('A'); | 78 var a = assertSuggestClass('A'); |
| 79 expect(a.element.isDeprecated, isTrue); | 79 expect(a.element.isDeprecated, isTrue); |
| 80 expect(a.element.isPrivate, isFalse); | 80 expect(a.element.isPrivate, isFalse); |
| 81 var b = assertSuggestClass('_B'); | 81 var b = assertSuggestClass('_B'); |
| 82 expect(b.element.isDeprecated, isFalse); | 82 expect(b.element.isDeprecated, isFalse); |
| 83 expect(b.element.isPrivate, isTrue); | 83 expect(b.element.isPrivate, isTrue); |
| 84 assertSuggestTopLevelVar('T', 'A'); | 84 assertSuggestTopLevelVar('T', 'A'); |
| 85 assertSuggestLibraryPrefix('x'); | 85 // Library prefix suggestion is provided by ImportedComputer |
| 86 assertNotSuggested('x'); |
| 86 } | 87 } |
| 87 | 88 |
| 88 test_ExpressionStatement_name() { | 89 test_ExpressionStatement_name() { |
| 89 // ExpressionStatement Block | 90 // ExpressionStatement Block |
| 90 addTestSource('class A {a() {var f; A ^}}'); | 91 addTestSource('class A {a() {var f; A ^}}'); |
| 91 expect(computeFast(), isTrue); | 92 expect(computeFast(), isTrue); |
| 92 assertNotSuggested('A'); | 93 assertNotSuggested('A'); |
| 93 assertNotSuggested('a'); | 94 assertNotSuggested('a'); |
| 94 assertNotSuggested('f'); | 95 assertNotSuggested('f'); |
| 95 } | 96 } |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 228 |
| 228 // VariableDeclaration VariableDeclarationList VariableDeclarationStat
ement | 229 // VariableDeclaration VariableDeclarationList VariableDeclarationStat
ement |
| 229 addTestSource('class A {a() {var f; {var x;} var e = ^ var g;}}'); | 230 addTestSource('class A {a() {var f; {var x;} var e = ^ var g;}}'); |
| 230 expect(computeFast(), isTrue); | 231 expect(computeFast(), isTrue); |
| 231 assertSuggestClass('A'); | 232 assertSuggestClass('A'); |
| 232 assertSuggestLocalVariable('f', null); | 233 assertSuggestLocalVariable('f', null); |
| 233 assertNotSuggested('g'); | 234 assertNotSuggested('g'); |
| 234 assertNotSuggested('x'); | 235 assertNotSuggested('x'); |
| 235 } | 236 } |
| 236 } | 237 } |
| OLD | NEW |