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

Side by Side Diff: pkg/analyzer/test/generated/incremental_resolver_test.dart

Issue 759763003: Function type aliases matching. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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/analyzer/lib/src/generated/incremental_resolver.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 engine.incremental_resolver_test; 5 library engine.incremental_resolver_test;
6 6
7 import 'package:analyzer/src/generated/ast.dart'; 7 import 'package:analyzer/src/generated/ast.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/engine.dart'; 9 import 'package:analyzer/src/generated/engine.dart';
10 import 'package:analyzer/src/generated/error.dart'; 10 import 'package:analyzer/src/generated/error.dart';
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 class T { 513 class T {
514 int A; 514 int A;
515 } 515 }
516 ''', r''' 516 ''', r'''
517 class T { 517 class T {
518 String A; 518 String A;
519 } 519 }
520 '''); 520 ''');
521 } 521 }
522 522
523 void test_false_functionTypeAlias_list_add() {
524 _assertCompilationUnitMatches(false, r'''
525 typedef A(int pa);
526 typedef B(String pb);
527 ''', r'''
528 typedef A(int pa);
529 typedef B(String pb);
530 typedef C(pc);
531 ''');
532 }
533
534 void test_false_functionTypeAlias_list_remove() {
535 _assertCompilationUnitMatches(false, r'''
536 typedef A(int pa);
537 typedef B(String pb);
538 typedef C(pc);
539 ''', r'''
540 typedef A(int pa);
541 typedef B(String pb);
542 ''');
543 }
544
545 void test_false_functionTypeAlias_parameters_list_add() {
546 _assertCompilationUnitMatches(false, r'''
547 typedef A(a);
548 ''', r'''
549 typedef A(a, b);
550 ''');
551 }
552
553 void test_false_functionTypeAlias_parameters_list_remove() {
554 _assertCompilationUnitMatches(false, r'''
555 typedef A(a, b);
556 ''', r'''
557 typedef A(a);
558 ''');
559 }
560
561 void test_false_functionTypeAlias_parameters_type_edit() {
562 _assertCompilationUnitMatches(false, r'''
563 typedef A(int p);
564 ''', r'''
565 typedef A(String p);
566 ''');
567 }
568
569 void test_false_functionTypeAlias_returnType_edit() {
570 _assertCompilationUnitMatches(false, r'''
571 typedef int A();
572 ''', r'''
573 typedef String A();
574 ''');
575 }
576
577 void test_false_functionTypeAlias_typeParameters_bounds_add() {
578 _assertCompilationUnitMatches(false, r'''
579 class A {}
580 typedef F<T>();
581 ''', r'''
582 class A {}
583 typedef F<T extends A>();
584 ''');
585 }
586
587 void test_false_functionTypeAlias_typeParameters_bounds_edit() {
588 _assertCompilationUnitMatches(false, r'''
589 class A {}
590 class B {}
591 typedef F<T extends A>();
592 ''', r'''
593 class A {}
594 typedef F<T extends B>();
595 ''');
596 }
597
598 void test_false_functionTypeAlias_typeParameters_bounds_remove() {
599 _assertCompilationUnitMatches(false, r'''
600 class A {}
601 typedef F<T extends A>();
602 ''', r'''
603 class A {}
604 typedef F<T>();
605 ''');
606 }
607
608 void test_false_functionTypeAlias_typeParameters_list_add() {
609 _assertCompilationUnitMatches(false, r'''
610 typedef F<A>();
611 ''', r'''
612 typedef F<A, B>();
613 ''');
614 }
615
616 void test_false_functionTypeAlias_typeParameters_list_remove() {
617 _assertCompilationUnitMatches(false, r'''
618 typedef F<A, B>();
619 ''', r'''
620 typedef F<A>();
621 ''');
622 }
623
523 void test_false_implementsClause_add() { 624 void test_false_implementsClause_add() {
524 _assertCompilationUnitMatches(false, r''' 625 _assertCompilationUnitMatches(false, r'''
525 class A {} 626 class A {}
526 class B {} 627 class B {}
527 ''', r''' 628 ''', r'''
528 class A {} 629 class A {}
529 class B implements A {} 630 class B implements A {}
530 '''); 631 ''');
531 } 632 }
532 633
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 A(this.field); 1323 A(this.field);
1223 } 1324 }
1224 ''', r''' 1325 ''', r'''
1225 class A { 1326 class A {
1226 int field; 1327 int field;
1227 A(this.field); 1328 A(this.field);
1228 } 1329 }
1229 '''); 1330 ''');
1230 } 1331 }
1231 1332
1333 void test_true_functionTypeAlias_list_reorder() {
1334 _assertCompilationUnitMatches(true, r'''
1335 typedef A(int pa);
1336 typedef B(String pb);
1337 typedef C(pc);
1338 ''', r'''
1339 typedef C(pc);
1340 typedef A(int pa);
1341 typedef B(String pb);
1342 ''');
1343 }
1344
1345 void test_true_functionTypeAlias_list_same() {
1346 _assertCompilationUnitMatches(true, r'''
1347 typedef String A(int pa);
1348 typedef int B(String pb);
1349 typedef C(pc);
1350 ''', r'''
1351 typedef String A(int pa);
1352 typedef int B(String pb);
1353 typedef C(pc);
1354 ''');
1355 }
1356
1357 void test_true_functionTypeAlias_typeParameters_list_same() {
1358 _assertCompilationUnitMatches(true, r'''
1359 typedef F<A, B, C>();
1360 ''', r'''
1361 typedef F<A, B, C>();
1362 ''');
1363 }
1364
1232 void test_true_implementsClause_same() { 1365 void test_true_implementsClause_same() {
1233 _assertCompilationUnitMatches(true, r''' 1366 _assertCompilationUnitMatches(true, r'''
1234 class A {} 1367 class A {}
1235 class B implements A {} 1368 class B implements A {}
1236 ''', r''' 1369 ''', r'''
1237 class A {} 1370 class A {}
1238 class B implements A {} 1371 class B implements A {}
1239 '''); 1372 ''');
1240 } 1373 }
1241 1374
(...skipping 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after
3202 _visitList(node.metadata, other.metadata); 3335 _visitList(node.metadata, other.metadata);
3203 _visitNode(node.identifier, other.identifier); 3336 _visitNode(node.identifier, other.identifier);
3204 } 3337 }
3205 3338
3206 static void assertSameResolution(CompilationUnit actual, 3339 static void assertSameResolution(CompilationUnit actual,
3207 CompilationUnit expected) { 3340 CompilationUnit expected) {
3208 _SameResolutionValidator validator = new _SameResolutionValidator(expected); 3341 _SameResolutionValidator validator = new _SameResolutionValidator(expected);
3209 actual.accept(validator); 3342 actual.accept(validator);
3210 } 3343 }
3211 } 3344 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/incremental_resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698