Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: pkg/analysis_server/test/services/completion/local_computer_test.dart

Issue 637703002: add suggestions for variable declaration assignment RHS (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_server/test/services/completion/invocation_computer_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 assertNotSuggested('A'); 246 assertNotSuggested('A');
247 } 247 }
248 248
249 test_TopLevelVariableDeclaration_untyped_name() { 249 test_TopLevelVariableDeclaration_untyped_name() {
250 // SimpleIdentifier VariableDeclaration VariableDeclarationList 250 // SimpleIdentifier VariableDeclaration VariableDeclarationList
251 // TopLevelVariableDeclaration 251 // TopLevelVariableDeclaration
252 addTestSource('class A {} var ^'); 252 addTestSource('class A {} var ^');
253 expect(computeFast(), isTrue); 253 expect(computeFast(), isTrue);
254 assertNotSuggested('A'); 254 assertNotSuggested('A');
255 } 255 }
256
257 test_VariableDeclarationStatement_name() {
258 // SimpleIdentifier VariableDeclaration VariableDeclarationList
259 // VariableDeclarationStatement
260 addTestSource('class _A {a() {var f; var ^}}');
261 expect(computeFast(), isTrue);
262 assertNotSuggested('A');
263 assertNotSuggested('a');
264 assertNotSuggested('f');
265 }
266
267 test_VariableDeclaration_RHS() {
268 // VariableDeclaration VariableDeclarationList
269 // VariableDeclarationStatement
270 addTestSource('class A {a() {var f; {var x;} var e = ^ var g;}}');
271 expect(computeFast(), isTrue);
272 assertSuggestClass('A');
273 assertSuggestLocalVariable('f', null);
274 assertNotSuggested('g');
275 assertNotSuggested('x');
276 }
277
278 xtest_ConstructorName_importedClass() {
279 // SimpleIdentifier PrefixedIdentifier TypeName ConstructorName
280 // InstanceCreationExpression
281 addSource('/testB.dart', '''
282 lib B;
283 class X {X.c(); X._d(); z() {}}''');
284 addTestSource('''
285 import "/testB.dart";
286 var m;
287 main() {new X.^}''');
288 return computeFull().then((_) {
289 assertNoSuggestions();
290 });
291 }
292
293 xtest_ConstructorName_localClass() {
294 // SimpleIdentifier PrefixedIdentifier TypeName ConstructorName
295 // InstanceCreationExpression
296 addTestSource('''
297 var m;
298 class X {X.c(); X._d(); z() {}}
299 main() {new X.^}''');
300 return computeFull().then((_) {
301 assertNoSuggestions();
302 });
303 }
304
305 xtest_InstanceCreationExpression() {
306 // SimpleIdentifier TypeName ConstructorName InstanceCreationExpression
307 addTestSource('class A {a() {var f; {var x;} new ^}} class B { }');
308 expect(computeFast(), isTrue);
309 assertSuggestClass('A');
310 assertSuggestClass('B');
311 assertNotSuggested('a');
312 assertNotSuggested('f');
313 assertNotSuggested('x');
314 }
315 } 256 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/services/completion/invocation_computer_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698