| 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 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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 class T { | 613 class T { |
| 614 int A; | 614 int A; |
| 615 } | 615 } |
| 616 ''', r''' | 616 ''', r''' |
| 617 class T { | 617 class T { |
| 618 String A; | 618 String A; |
| 619 } | 619 } |
| 620 '''); | 620 '''); |
| 621 } | 621 } |
| 622 | 622 |
| 623 void test_false_function_async_add() { |
| 624 _assertDoesNotMatch(r''' |
| 625 main() {} |
| 626 ''', r''' |
| 627 main() async {} |
| 628 '''); |
| 629 } |
| 630 |
| 631 void test_false_function_async_remove() { |
| 632 _assertDoesNotMatch(r''' |
| 633 main() async {} |
| 634 ''', r''' |
| 635 main() {} |
| 636 '''); |
| 637 } |
| 638 |
| 639 void test_false_function_generator_add() { |
| 640 _assertDoesNotMatch(r''' |
| 641 main() async {} |
| 642 ''', r''' |
| 643 main() async* {} |
| 644 '''); |
| 645 } |
| 646 |
| 647 void test_false_function_generator_remove() { |
| 648 _assertDoesNotMatch(r''' |
| 649 main() async* {} |
| 650 ''', r''' |
| 651 main() async {} |
| 652 '''); |
| 653 } |
| 654 |
| 623 void test_false_functionTypeAlias_list_add() { | 655 void test_false_functionTypeAlias_list_add() { |
| 624 _assertDoesNotMatch(r''' | 656 _assertDoesNotMatch(r''' |
| 625 typedef A(int pa); | 657 typedef A(int pa); |
| 626 typedef B(String pb); | 658 typedef B(String pb); |
| 627 ''', r''' | 659 ''', r''' |
| 628 typedef A(int pa); | 660 typedef A(int pa); |
| 629 typedef B(String pb); | 661 typedef B(String pb); |
| 630 typedef C(pc); | 662 typedef C(pc); |
| 631 '''); | 663 '''); |
| 632 } | 664 } |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 void m() {} | 950 void m() {} |
| 919 } | 951 } |
| 920 ''', r''' | 952 ''', r''' |
| 921 const my_annotation = const Object(); | 953 const my_annotation = const Object(); |
| 922 class A { | 954 class A { |
| 923 void m() {} | 955 void m() {} |
| 924 } | 956 } |
| 925 '''); | 957 '''); |
| 926 } | 958 } |
| 927 | 959 |
| 960 void test_false_method_async_add() { |
| 961 _assertDoesNotMatchOK(r''' |
| 962 class A { |
| 963 m() {} |
| 964 } |
| 965 ''', r''' |
| 966 class A { |
| 967 m() async {} |
| 968 } |
| 969 '''); |
| 970 } |
| 971 |
| 972 void test_false_method_async_remove() { |
| 973 _assertDoesNotMatchOK(r''' |
| 974 class A { |
| 975 m() async {} |
| 976 } |
| 977 ''', r''' |
| 978 class A { |
| 979 m() {} |
| 980 } |
| 981 '''); |
| 982 } |
| 983 |
| 984 void test_false_method_generator_add() { |
| 985 _assertDoesNotMatchOK(r''' |
| 986 class A { |
| 987 m() async {} |
| 988 } |
| 989 ''', r''' |
| 990 class A { |
| 991 m() async* {} |
| 992 } |
| 993 '''); |
| 994 } |
| 995 |
| 996 void test_false_method_generator_remove() { |
| 997 _assertDoesNotMatchOK(r''' |
| 998 class A { |
| 999 m() async* {} |
| 1000 } |
| 1001 ''', r''' |
| 1002 class A { |
| 1003 m() async {} |
| 1004 } |
| 1005 '''); |
| 1006 } |
| 1007 |
| 928 void test_false_method_list_add() { | 1008 void test_false_method_list_add() { |
| 929 _assertDoesNotMatchOK(r''' | 1009 _assertDoesNotMatchOK(r''' |
| 930 class A { | 1010 class A { |
| 931 a() {} | 1011 a() {} |
| 932 b() {} | 1012 b() {} |
| 933 } | 1013 } |
| 934 ''', r''' | 1014 ''', r''' |
| 935 class A { | 1015 class A { |
| 936 a() {} | 1016 a() {} |
| 937 b() {} | 1017 b() {} |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1768 class MyAnnotation { | 1848 class MyAnnotation { |
| 1769 const MyAnnotation(); | 1849 const MyAnnotation(); |
| 1770 } | 1850 } |
| 1771 class A { | 1851 class A { |
| 1772 @MyAnnotation() | 1852 @MyAnnotation() |
| 1773 void m() {} | 1853 void m() {} |
| 1774 } | 1854 } |
| 1775 '''); | 1855 '''); |
| 1776 } | 1856 } |
| 1777 | 1857 |
| 1858 void test_true_method_async() { |
| 1859 _assertMatches(r''' |
| 1860 class A { |
| 1861 m() async {} |
| 1862 } |
| 1863 ''', r''' |
| 1864 class A { |
| 1865 m() async {} |
| 1866 } |
| 1867 '''); |
| 1868 } |
| 1869 |
| 1778 void test_true_method_list_reorder() { | 1870 void test_true_method_list_reorder() { |
| 1779 _assertMatches(r''' | 1871 _assertMatches(r''' |
| 1780 class A { | 1872 class A { |
| 1781 a() {} | 1873 a() {} |
| 1782 b() {} | 1874 b() {} |
| 1783 c() {} | 1875 c() {} |
| 1784 } | 1876 } |
| 1785 ''', r''' | 1877 ''', r''' |
| 1786 class A { | 1878 class A { |
| 1787 c() {} | 1879 c() {} |
| (...skipping 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3678 } | 3770 } |
| 3679 } | 3771 } |
| 3680 | 3772 |
| 3681 | 3773 |
| 3682 class _Edit { | 3774 class _Edit { |
| 3683 final int offset; | 3775 final int offset; |
| 3684 final int length; | 3776 final int length; |
| 3685 final String replacement; | 3777 final String replacement; |
| 3686 _Edit(this.offset, this.length, this.replacement); | 3778 _Edit(this.offset, this.length, this.replacement); |
| 3687 } | 3779 } |
| OLD | NEW |