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

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

Issue 1025903002: improve parser recovery of type argument list (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: cleanup and fix test Created 5 years, 9 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
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.target; 5 library test.services.completion.target;
6 6
7 import 'package:analysis_server/src/services/completion/completion_target.dart'; 7 import 'package:analysis_server/src/services/completion/completion_target.dart';
8 import 'package:analyzer/src/generated/ast.dart'; 8 import 'package:analyzer/src/generated/ast.dart';
9 import 'package:analyzer/src/generated/source.dart'; 9 import 'package:analyzer/src/generated/source.dart';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 assertTarget('zoo', 'zoo(z) {}'); 468 assertTarget('zoo', 'zoo(z) {}');
469 } 469 }
470 470
471 test_MethodDeclaration_returnType_afterStarDocComment2() { 471 test_MethodDeclaration_returnType_afterStarDocComment2() {
472 // MethodDeclaration ClassDeclaration CompilationUnit 472 // MethodDeclaration ClassDeclaration CompilationUnit
473 addTestSource('class C2 {/** */^ zoo(z) { } String name; }'); 473 addTestSource('class C2 {/** */^ zoo(z) { } String name; }');
474 assertTarget('zoo', 'zoo(z) {}'); 474 assertTarget('zoo', 'zoo(z) {}');
475 } 475 }
476 476
477 test_TypeArgumentList() { 477 test_TypeArgumentList() {
478 // SimpleIdentifier BinaryExpression ExpressionStatement 478 // TypeName TypeArgumentList TypeName
479 addTestSource('main() { C<^> c; }'); 479 addTestSource('main() { C<^> c; }');
480 assertTarget('', 'C < '); 480 assertTarget('', '<>');
481 } 481 }
482 482
483 test_TypeArgumentList2() { 483 test_TypeArgumentList2() {
484 // TypeName TypeArgumentList TypeName 484 // TypeName TypeArgumentList TypeName
485 addTestSource('main() { C<C^> c; }'); 485 addTestSource('main() { C<C^> c; }');
486 assertTarget('C', '<C>'); 486 assertTarget('C', '<C>');
487 } 487 }
488 488
489 test_VariableDeclaration_lhs_identifier_after() { 489 test_VariableDeclaration_lhs_identifier_after() {
490 // VariableDeclaration VariableDeclarationList 490 // VariableDeclaration VariableDeclarationList
491 addTestSource('main() {int b^ = 1;}'); 491 addTestSource('main() {int b^ = 1;}');
492 assertTarget('b = 1', 'int b = 1'); 492 assertTarget('b = 1', 'int b = 1');
493 } 493 }
494 494
495 test_VariableDeclaration_lhs_identifier_before() { 495 test_VariableDeclaration_lhs_identifier_before() {
496 // VariableDeclaration VariableDeclarationList 496 // VariableDeclaration VariableDeclarationList
497 addTestSource('main() {int ^b = 1;}'); 497 addTestSource('main() {int ^b = 1;}');
498 assertTarget('b = 1', 'int b = 1'); 498 assertTarget('b = 1', 'int b = 1');
499 } 499 }
500 } 500 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/optype.dart ('k') | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698