| 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.completion.support; | 5 library test.completion.support; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'completion_test_support.dart'; | 9 import 'completion_test_support.dart'; |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 CompletionTestCase.buildTests('testCommentSnippets004', ''' | 37 CompletionTestCase.buildTests('testCommentSnippets004', ''' |
| 38 class A {!1int x; !2mth() {!3int y = this.!5x!6;}}class B{}''', | 38 class A {!1int x; !2mth() {!3int y = this.!5x!6;}}class B{}''', |
| 39 <String>["1+A", "2+B", "3+x", "3-y", "5+mth", "6+x"]); | 39 <String>["1+A", "2+B", "3+x", "3-y", "5+mth", "6+x"]); |
| 40 | 40 |
| 41 CompletionTestCase.buildTests('testCommentSnippets005', ''' | 41 CompletionTestCase.buildTests('testCommentSnippets005', ''' |
| 42 class Date { static Date JUN, JUL;}class X { m() { return Da!1te.JU!2L; }}''', | 42 class Date { static Date JUN, JUL;}class X { m() { return Da!1te.JU!2L; }}''', |
| 43 <String>["1+Date", "2+JUN", "2+JUL"]); | 43 <String>["1+Date", "2+JUN", "2+JUL"]); |
| 44 | 44 |
| 45 CompletionTestCase.buildTests('testCommentSnippets007', ''' | 45 CompletionTestCase.buildTests('testCommentSnippets007', ''' |
| 46 class C {mth(Map x, !1) {}mtf(!2, Map x) {}m() {for (in!3t i=0; i<5; i++); A!4 x
;}}class int{}class Arrays{}class bool{}''', | 46 class C {mth(Map x, !1) {}mtf(!2, Map x) {}m() {for (in!3t i=0; i<5; i++); A!4 x
;}}class int{}class Arrays{}''', |
| 47 <String>["1+bool", "2+bool", "3+int", "4+Arrays"], | 47 <String>["1+bool", "2+bool", "3+int", "4+Arrays"], |
| 48 failingTests: '3'); | 48 failingTests: '3'); |
| 49 | 49 |
| 50 CompletionTestCase.buildTests('testCommentSnippets008', ''' | 50 CompletionTestCase.buildTests('testCommentSnippets008', ''' |
| 51 class Date{}final num M = Dat!1''', <String>["1+Date"]); | 51 class Date{}final num M = Dat!1''', <String>["1+Date"]); |
| 52 | 52 |
| 53 // space, char, eol are important | 53 // space, char, eol are important |
| 54 CompletionTestCase.buildTests('testCommentSnippets009', ''' | 54 CompletionTestCase.buildTests('testCommentSnippets009', ''' |
| 55 class Map{}class Maps{}class x extends!5 !2M!3 !4implements!6 !1\n{}''', | 55 class Maps{}class x extends!5 !2M!3 !4implements!6 !1\n{}''', |
| 56 <String>[ | 56 <String>[ |
| 57 "1+Map", | 57 "1+Map", |
| 58 "2+Maps", | 58 "2+Maps", |
| 59 "3+Maps", | 59 "3+Maps", |
| 60 "4-Maps", | 60 "4-Maps", |
| 61 "4+implements", | 61 "4+implements", |
| 62 "5-Maps", | 62 "5-Maps", |
| 63 "6-Map", | 63 "6-Map", |
| 64 "6+implements"], | 64 "6+implements"], |
| 65 failingTests: '46'); | 65 failingTests: '46'); |
| 66 | 66 |
| 67 // space, char, eol are important | 67 // space, char, eol are important |
| 68 CompletionTestCase.buildTests('testCommentSnippets010', ''' | 68 CompletionTestCase.buildTests('testCommentSnippets010', ''' |
| 69 class Map{}class x implements !1{}''', <String>["1+Map"], failingTests: '1'); | 69 class x implements !1{}''', <String>["1+Map"]); |
| 70 | 70 |
| 71 // space, char, eol are important | 71 // space, char, eol are important |
| 72 CompletionTestCase.buildTests('testCommentSnippets011', ''' | 72 CompletionTestCase.buildTests('testCommentSnippets011', ''' |
| 73 class Map{}class x implements M!1{}''', <String>["1+Map"], failingTests: '1'); | 73 class x implements M!1{}''', <String>["1+Map"]); |
| 74 | 74 |
| 75 // space, char, eol are important | 75 // space, char, eol are important |
| 76 CompletionTestCase.buildTests('testCommentSnippets012', ''' | 76 CompletionTestCase.buildTests('testCommentSnippets012', ''' |
| 77 class Map{}class x implements M!1\n{}''', <String>["1+Map"], failingTests: '1'); | 77 class x implements M!1\n{}''', <String>["1+Map"]); |
| 78 | 78 |
| 79 CompletionTestCase.buildTests('testCommentSnippets013', ''' | 79 CompletionTestCase.buildTests('testCommentSnippets013', ''' |
| 80 class num{}class x !2{!1}!3''', | 80 class x !2{!1}!3''', |
| 81 <String>["1+num", "2-num", "3-num"], | 81 <String>["1+num", "2-num", "3-num"]); |
| 82 failingTests: '1'); | |
| 83 | 82 |
| 84 // trailing space is important | 83 // trailing space is important |
| 85 CompletionTestCase.buildTests('testCommentSnippets014', ''' | 84 CompletionTestCase.buildTests('testCommentSnippets014', ''' |
| 86 class num{}typedef n!1 ;''', <String>["1+num"]); | 85 typedef n!1 ;''', <String>["1+num"]); |
| 87 | 86 |
| 88 CompletionTestCase.buildTests('testCommentSnippets015', ''' | 87 CompletionTestCase.buildTests('testCommentSnippets015', ''' |
| 89 class D {f(){} g(){f!1(f!2);}}''', <String>["1+f", "2+f"]); | 88 class D {f(){} g(){f!1(f!2);}}''', <String>["1+f", "2+f"]); |
| 90 | 89 |
| 91 CompletionTestCase.buildTests('testCommentSnippets016', ''' | 90 CompletionTestCase.buildTests('testCommentSnippets016', ''' |
| 92 class F {m() { m(); !1}}''', <String>["1+m"]); | 91 class F {m() { m(); !1}}''', <String>["1+m"]); |
| 93 | 92 |
| 94 CompletionTestCase.buildTests('testCommentSnippets017', ''' | 93 CompletionTestCase.buildTests('testCommentSnippets017', ''' |
| 95 class F {var x = !1false;}''', <String>["1+true"], failingTests: '1'); | 94 class F {var x = !1false;}''', <String>["1+true"], failingTests: '1'); |
| 96 | 95 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 class Bar<T extends Foo> {const Bar(!1T!2 k);T!3 m(T!4 a, T!5 b){}final T!6 f =
null;}''', | 154 class Bar<T extends Foo> {const Bar(!1T!2 k);T!3 m(T!4 a, T!5 b){}final T!6 f =
null;}''', |
| 156 <String>["1+T", "2+T", "3+T", "4+T", "5+T", "6+T"], | 155 <String>["1+T", "2+T", "3+T", "4+T", "5+T", "6+T"], |
| 157 failingTests: '123456'); | 156 failingTests: '123456'); |
| 158 | 157 |
| 159 CompletionTestCase.buildTests('testCommentSnippets031', ''' | 158 CompletionTestCase.buildTests('testCommentSnippets031', ''' |
| 160 class Bar<T extends Foo> {m(x){if (x is !1) return;if (x is!!!2)}}''', | 159 class Bar<T extends Foo> {m(x){if (x is !1) return;if (x is!!!2)}}''', |
| 161 <String>["1+Bar", "1+T", "2+T", "2+Bar"], | 160 <String>["1+Bar", "1+T", "2+T", "2+Bar"], |
| 162 failingTests: '12'); | 161 failingTests: '12'); |
| 163 | 162 |
| 164 CompletionTestCase.buildTests('testCommentSnippets032', ''' | 163 CompletionTestCase.buildTests('testCommentSnippets032', ''' |
| 165 class Fit{}class Bar<T extends Fooa> {const F!1ara();}''', | 164 class Fit{}class Bar<T extends Fooa> {const !2F!1ara();}''', |
| 166 <String>["1+Fit", "1+Fara", "1-Bar"]); | 165 <String>["1+Fit", "1+Fara", "1-Bar", "2+Fit"], |
| 166 failingTests: '1'); |
| 167 | 167 |
| 168 // Type propagation | 168 // Type propagation |
| 169 CompletionTestCase.buildTests('testCommentSnippets033', ''' | 169 CompletionTestCase.buildTests('testCommentSnippets033', ''' |
| 170 class List{add(){}length(){}}t1() {var x;if (x is List) {x.!1add(3);}}''', | 170 class List{add(){}length(){}}t1() {var x;if (x is List) {x.!1add(3);}}''', |
| 171 <String>["1+add", "1+length"]); | 171 <String>["1+add", "1+length"]); |
| 172 | 172 |
| 173 // Type propagation | 173 // Type propagation |
| 174 CompletionTestCase.buildTests('testCommentSnippets035', ''' | 174 CompletionTestCase.buildTests('testCommentSnippets035', ''' |
| 175 class List{clear(){}length(){}}t3() {var x=new List(), y=x.!1length();x.!2clear(
);}''', | 175 class List{clear(){}length(){}}t3() {var x=new List(), y=x.!1length();x.!2clear(
);}''', |
| 176 <String>["1+length", "2+clear"]); | 176 <String>["1+length", "2+clear"]); |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 class List{}class Map{}typedef X = !1Lis!2t with !3Ma!4p;''', | 648 class List{}class Map{}typedef X = !1Lis!2t with !3Ma!4p;''', |
| 649 <String>["1+Map", "2+List", "2-Map", "3+List", "4+Map", "4-List"], | 649 <String>["1+Map", "2+List", "2-Map", "3+List", "4+Map", "4-List"], |
| 650 failingTests: '1234'); | 650 failingTests: '1234'); |
| 651 | 651 |
| 652 CompletionTestCase.buildTests('testCommentSnippets085', ''' | 652 CompletionTestCase.buildTests('testCommentSnippets085', ''' |
| 653 class List{}class Map{}class Z extends List with !1Ma!2p {}''', | 653 class List{}class Map{}class Z extends List with !1Ma!2p {}''', |
| 654 <String>["1+List", "1+Map", "2+Map", "2-List"], | 654 <String>["1+List", "1+Map", "2+Map", "2-List"], |
| 655 failingTests: '12'); | 655 failingTests: '12'); |
| 656 | 656 |
| 657 CompletionTestCase.buildTests('testCommentSnippets086', ''' | 657 CompletionTestCase.buildTests('testCommentSnippets086', ''' |
| 658 class Q{f(){xy() {!2};x!1y();}}''', | 658 class Q{f(){xy() {!2};x!1y();}}''', <String>["1+xy", "2+f", "2-xy"]); |
| 659 <String>["1+xy", "2+f", "2-xy"]); | |
| 660 | 659 |
| 661 CompletionTestCase.buildTests('testCommentSnippets087', ''' | 660 CompletionTestCase.buildTests('testCommentSnippets087', ''' |
| 662 class Map{}class Q extends Object with !1Map {}''', | 661 class Map{}class Q extends Object with !1Map {}''', |
| 663 <String>["1+Map", "1-HashMap"], | 662 <String>["1+Map", "1-HashMap"], |
| 664 failingTests: '1'); | 663 failingTests: '1'); |
| 665 | 664 |
| 666 CompletionTestCase.buildTests('testCommentSnippets088', ''' | 665 CompletionTestCase.buildTests('testCommentSnippets088', ''' |
| 667 class A { | 666 class A { |
| 668 int f; | 667 int f; |
| 669 B m(){} | 668 B m(){} |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 import 'dart:math' show !1"''', | 856 import 'dart:math' show !1"''', |
| 858 <String>["1+PI", "1+sin", "1+Random", "1-String"], | 857 <String>["1+PI", "1+sin", "1+Random", "1-String"], |
| 859 failingTests: '1'); | 858 failingTests: '1'); |
| 860 | 859 |
| 861 CompletionTestCase.buildTests('testCompletion_combinator_usePrefix', ''' | 860 CompletionTestCase.buildTests('testCompletion_combinator_usePrefix', ''' |
| 862 import 'dart:math' show s!1"''', | 861 import 'dart:math' show s!1"''', |
| 863 <String>["1+sin", "1+sqrt", "1-cos", "1-String"], | 862 <String>["1+sin", "1+sqrt", "1-cos", "1-String"], |
| 864 failingTests: '1'); | 863 failingTests: '1'); |
| 865 | 864 |
| 866 CompletionTestCase.buildTests('testCompletion_constructor_field', ''' | 865 CompletionTestCase.buildTests('testCompletion_constructor_field', ''' |
| 867 class X { X(this.field); int f!1ield;}''', <String>["1+field"]); | 866 class X { X(this.field); int f!1ield;}''', |
| 867 <String>["1+field"], |
| 868 failingTests: '1'); |
| 868 | 869 |
| 869 CompletionTestCase.buildTests( | 870 CompletionTestCase.buildTests( |
| 870 'testCompletion_constructorArguments_showOnlyCurrent', | 871 'testCompletion_constructorArguments_showOnlyCurrent', |
| 871 ''' | 872 ''' |
| 872 class A { | 873 class A { |
| 873 A.first(int p); | 874 A.first(int p); |
| 874 A.second(double p); | 875 A.second(double p); |
| 875 } | 876 } |
| 876 main() { | 877 main() { |
| 877 new A.first(!1); | 878 new A.first(!1); |
| 878 }''', <String>["1+A.first", "1-A.second"], failingTests: '1'); | 879 }''', <String>["1+A.first", "1-A.second"], failingTests: '1'); |
| 879 | 880 |
| 880 CompletionTestCase.buildTests( | 881 CompletionTestCase.buildTests( |
| 881 'testCompletion_constructorArguments_whenPrefixedType', | 882 'testCompletion_constructorArguments_whenPrefixedType', |
| 882 ''' | 883 ''' |
| 883 import 'dart:math' as m; | 884 import 'dart:math' as m; |
| 884 main() { | 885 main() { |
| 885 new m.Random(!1); | 886 new m.Random(!1); |
| 886 }''', <String>["1+Random:ARGUMENT_LIST"], failingTests: '1'); | 887 }''', <String>["1+Random:ARGUMENT_LIST"], failingTests: '1'); |
| 887 | 888 |
| 888 CompletionTestCase.buildTests( | 889 CompletionTestCase.buildTests( |
| 889 'testCompletion_dartDoc_reference_forClass', | 890 'testCompletion_dartDoc_reference_forClass', |
| 890 ''' | 891 ''' |
| 891 /** | 892 /** |
| 892 * [int!1] | 893 * [int!1] |
| 893 * [method!2] | 894 * [method!2] |
| 894 */ | 895 */ |
| 895 class AAA { | 896 class AAA { |
| 896 methodA() {} | 897 methodA() {} |
| 897 }''', <String>["1+int", "1-method", "2+methodA", "2-int"], failingTests: '1'); | 898 }''', <String>["1+int", "1-method", "2+methodA", "2-int"]); |
| 898 | 899 |
| 899 CompletionTestCase.buildTests( | 900 CompletionTestCase.buildTests( |
| 900 'testCompletion_dartDoc_reference_forConstructor', | 901 'testCompletion_dartDoc_reference_forConstructor', |
| 901 ''' | 902 ''' |
| 902 class A { | 903 class A { |
| 903 /** | 904 /** |
| 904 * [aa!1] | 905 * [aa!1] |
| 905 * [int!2] | 906 * [int!2] |
| 906 * [method!3] | 907 * [method!3] |
| 907 */ | 908 */ |
| 908 A.named(aaa, bbb) {} | 909 A.named(aaa, bbb) {} |
| 909 methodA() {} | 910 methodA() {} |
| 910 }''', | 911 }''', |
| 911 <String>["1+aaa", "1-bbb", "2+int", "2-double", "3+methodA"], | 912 <String>["1+aaa", "1-bbb", "2+int", "2-double", "3+methodA"], |
| 912 failingTests: '12'); | 913 failingTests: '1'); |
| 913 | 914 |
| 914 CompletionTestCase.buildTests( | 915 CompletionTestCase.buildTests( |
| 915 'testCompletion_dartDoc_reference_forFunction', | 916 'testCompletion_dartDoc_reference_forFunction', |
| 916 ''' | 917 ''' |
| 917 /** | 918 /** |
| 918 * [aa!1] | 919 * [aa!1] |
| 919 * [int!2] | 920 * [int!2] |
| 920 * [function!3] | 921 * [function!3] |
| 921 */ | 922 */ |
| 922 functionA(aaa, bbb) {} | 923 functionA(aaa, bbb) {} |
| 923 functionB() {}''', | 924 functionB() {}''', |
| 924 <String>[ | 925 <String>[ |
| 925 "1+aaa", | 926 "1+aaa", |
| 926 "1-bbb", | 927 "1-bbb", |
| 927 "2+int", | 928 "2+int", |
| 928 "2-double", | 929 "2-double", |
| 929 "3+functionA", | 930 "3+functionA", |
| 930 "3+functionB", | 931 "3+functionB", |
| 931 "3-int"], | 932 "3-int"], |
| 932 failingTests: '12'); | 933 failingTests: '1'); |
| 933 | 934 |
| 934 CompletionTestCase.buildTests( | 935 CompletionTestCase.buildTests( |
| 935 'testCompletion_dartDoc_reference_forFunctionTypeAlias', | 936 'testCompletion_dartDoc_reference_forFunctionTypeAlias', |
| 936 ''' | 937 ''' |
| 937 /** | 938 /** |
| 938 * [aa!1] | 939 * [aa!1] |
| 939 * [int!2] | 940 * [int!2] |
| 940 * [Function!3] | 941 * [Function!3] |
| 941 */ | 942 */ |
| 942 typedef FunctionA(aaa, bbb) {} | 943 typedef FunctionA(aaa, bbb) {} |
| 943 typedef FunctionB() {}''', | 944 typedef FunctionB() {}''', |
| 944 <String>[ | 945 <String>[ |
| 945 "1+aaa", | 946 "1+aaa", |
| 946 "1-bbb", | 947 "1-bbb", |
| 947 "2+int", | 948 "2+int", |
| 948 "2-double", | 949 "2-double", |
| 949 "3+FunctionA", | 950 "3+FunctionA", |
| 950 "3+FunctionB", | 951 "3+FunctionB", |
| 951 "3-int"], | 952 "3-int"], |
| 952 failingTests: '12'); | 953 failingTests: '1'); |
| 953 | 954 |
| 954 CompletionTestCase.buildTests( | 955 CompletionTestCase.buildTests( |
| 955 'testCompletion_dartDoc_reference_forMethod', | 956 'testCompletion_dartDoc_reference_forMethod', |
| 956 ''' | 957 ''' |
| 957 class A { | 958 class A { |
| 958 /** | 959 /** |
| 959 * [aa!1] | 960 * [aa!1] |
| 960 * [int!2] | 961 * [int!2] |
| 961 * [method!3] | 962 * [method!3] |
| 962 */ | 963 */ |
| 963 methodA(aaa, bbb) {} | 964 methodA(aaa, bbb) {} |
| 964 methodB() {} | 965 methodB() {} |
| 965 }''', | 966 }''', |
| 966 <String>[ | 967 <String>[ |
| 967 "1+aaa", | 968 "1+aaa", |
| 968 "1-bbb", | 969 "1-bbb", |
| 969 "2+int", | 970 "2+int", |
| 970 "2-double", | 971 "2-double", |
| 971 "3+methodA", | 972 "3+methodA", |
| 972 "3+methodB", | 973 "3+methodB", |
| 973 "3-int"], | 974 "3-int"]); |
| 974 failingTests: '2'); | |
| 975 | 975 |
| 976 CompletionTestCase.buildTests( | 976 CompletionTestCase.buildTests( |
| 977 'testCompletion_dartDoc_reference_incomplete', | 977 'testCompletion_dartDoc_reference_incomplete', |
| 978 ''' | 978 ''' |
| 979 /** | 979 /** |
| 980 * [doubl!1 some text | 980 * [doubl!1 some text |
| 981 * other text | 981 * other text |
| 982 */ | 982 */ |
| 983 class A {} | 983 class A {} |
| 984 /** | 984 /** |
| 985 * [!2 some text | 985 * [!2 some text |
| 986 * other text | 986 * other text |
| 987 */ | 987 */ |
| 988 class B {} | 988 class B {} |
| 989 /** | 989 /** |
| 990 * [!3] some text | 990 * [!3] some text |
| 991 */ | 991 */ |
| 992 class C {}''', | 992 class C {}''', |
| 993 <String>["1+double", "1-int", "2+int", "2+String", "3+int", "3+String"], | 993 <String>["1+double", "1-int", "2+int", "2+String", "3+int", "3+String"])
; |
| 994 failingTests: '123'); | |
| 995 | 994 |
| 996 CompletionTestCase.buildTests('testCompletion_double_inFractionPart', ''' | 995 CompletionTestCase.buildTests('testCompletion_double_inFractionPart', ''' |
| 997 main() { | 996 main() { |
| 998 1.0!1 | 997 1.0!1 |
| 999 }''', <String>["1-abs", "1-main"]); | 998 }''', <String>["1-abs", "1-main"]); |
| 1000 | 999 |
| 1001 CompletionTestCase.buildTests('testCompletion_enum', ''' | 1000 CompletionTestCase.buildTests('testCompletion_enum', ''' |
| 1002 enum MyEnum {A, B, C} | 1001 enum MyEnum {A, B, C} |
| 1003 main() { | 1002 main() { |
| 1004 MyEnum.!1; | 1003 MyEnum.!1; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 import !1 | 1040 import !1 |
| 1042 | 1041 |
| 1043 class A {}''', <String>["1+'dart:!';", "1+'package:!';"], failingTests: '1'); | 1042 class A {}''', <String>["1+'dart:!';", "1+'package:!';"], failingTests: '1'); |
| 1044 | 1043 |
| 1045 CompletionTestCase.buildTests('testCompletion_forStmt_vars', ''' | 1044 CompletionTestCase.buildTests('testCompletion_forStmt_vars', ''' |
| 1046 class int{}class Foo { mth() { for (in!1t i = 0; i!2 < 5; i!3++); }}''', | 1045 class int{}class Foo { mth() { for (in!1t i = 0; i!2 < 5; i!3++); }}''', |
| 1047 <String>["1+int", "2+i", "3+i"], | 1046 <String>["1+int", "2+i", "3+i"], |
| 1048 failingTests: '1'); | 1047 failingTests: '1'); |
| 1049 | 1048 |
| 1050 CompletionTestCase.buildTests('testCompletion_function', ''' | 1049 CompletionTestCase.buildTests('testCompletion_function', ''' |
| 1051 class String{}class Foo { int boo = 7; mth() { PNGS.sort((String a, Str!1) => a.
compareTo(b)); }}''', | 1050 class Foo { int boo = 7; mth() { PNGS.sort((String a, Str!1) => a.compareTo(b));
}}''', |
| 1052 <String>["1+String"]); | 1051 <String>["1+String"]); |
| 1053 | 1052 |
| 1054 CompletionTestCase.buildTests('testCompletion_function_partial', ''' | 1053 CompletionTestCase.buildTests('testCompletion_function_partial', ''' |
| 1055 class String{}class Foo { int boo = 7; mth() { PNGS.sort((String a, Str!1)); }}'
'', | 1054 class Foo { int boo = 7; mth() { PNGS.sort((String a, Str!1)); }}''', |
| 1056 <String>["1+String"], | 1055 <String>["1+String"]); |
| 1057 failingTests: '1'); | |
| 1058 | 1056 |
| 1059 CompletionTestCase.buildTests( | 1057 CompletionTestCase.buildTests( |
| 1060 'testCompletion_functionTypeParameter_namedArgument', | 1058 'testCompletion_functionTypeParameter_namedArgument', |
| 1061 ''' | 1059 ''' |
| 1062 typedef FFF(a, b, {x1, x2, y}); | 1060 typedef FFF(a, b, {x1, x2, y}); |
| 1063 main(FFF fff) { | 1061 main(FFF fff) { |
| 1064 fff(1, 2, !1)!2; | 1062 fff(1, 2, !1)!2; |
| 1065 }''', <String>["1+x1", "2-x2"], failingTests: '1'); | 1063 }''', <String>["1+x1", "2-x2"], failingTests: '1'); |
| 1066 | 1064 |
| 1067 CompletionTestCase.buildTests('testCompletion_ifStmt_field1', ''' | 1065 CompletionTestCase.buildTests('testCompletion_ifStmt_field1', ''' |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1475 'testCompletion_return_withIdentifierPrefix', | 1473 'testCompletion_return_withIdentifierPrefix', |
| 1476 ''' | 1474 ''' |
| 1477 f() { var vvv = 42; return v!1 }''', <String>["1+vvv"]); | 1475 f() { var vvv = 42; return v!1 }''', <String>["1+vvv"]); |
| 1478 | 1476 |
| 1479 CompletionTestCase.buildTests('testCompletion_return_withoutExpression', ''' | 1477 CompletionTestCase.buildTests('testCompletion_return_withoutExpression', ''' |
| 1480 f() { var vvv = 42; return !1 }''', <String>["1+vvv"]); | 1478 f() { var vvv = 42; return !1 }''', <String>["1+vvv"]); |
| 1481 | 1479 |
| 1482 CompletionTestCase.buildTests('testCompletion_staticField1', ''' | 1480 CompletionTestCase.buildTests('testCompletion_staticField1', ''' |
| 1483 class num{}class Sunflower {static final n!2um MAX_D = 300;nu!3m xc, yc;Sun!4flo
wer() {x!Xc = y!Yc = MA!1 }}''', | 1481 class num{}class Sunflower {static final n!2um MAX_D = 300;nu!3m xc, yc;Sun!4flo
wer() {x!Xc = y!Yc = MA!1 }}''', |
| 1484 <String>["1+MAX_D", "X+xc", "Y+yc", "2+num", "3+num", "4+Sunflower"], | 1482 <String>["1+MAX_D", "X+xc", "Y+yc", "2+num", "3+num", "4+Sunflower"], |
| 1485 failingTests: '23'); | 1483 failingTests: '234'); |
| 1486 | 1484 |
| 1487 CompletionTestCase.buildTests('testCompletion_super_superType', ''' | 1485 CompletionTestCase.buildTests('testCompletion_super_superType', ''' |
| 1488 class A { | 1486 class A { |
| 1489 var fa; | 1487 var fa; |
| 1490 ma() {} | 1488 ma() {} |
| 1491 } | 1489 } |
| 1492 class B extends A { | 1490 class B extends A { |
| 1493 var fb; | 1491 var fb; |
| 1494 mb() {} | 1492 mb() {} |
| 1495 main() { | 1493 main() { |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1870 int b() => this.!1a(); | 1868 int b() => this.!1a(); |
| 1871 }''', <String>["1+a"]); | 1869 }''', <String>["1+a"]); |
| 1872 | 1870 |
| 1873 CompletionTestCase.buildTests('test004', ''' | 1871 CompletionTestCase.buildTests('test004', ''' |
| 1874 class A { | 1872 class A { |
| 1875 int x; | 1873 int x; |
| 1876 A() : this.!1x = 1; | 1874 A() : this.!1x = 1; |
| 1877 A.b() : this(); | 1875 A.b() : this(); |
| 1878 A.c() : this.!2b(); | 1876 A.c() : this.!2b(); |
| 1879 g() => new A.!3c(); | 1877 g() => new A.!3c(); |
| 1880 }''', <String>["1+x", "2+b", "3+c"], failingTests: '2'); | 1878 }''', <String>["1+x", "2+b", "3+c"], failingTests: '12'); |
| 1881 | 1879 |
| 1882 CompletionTestCase.buildTests('test005', ''' | 1880 CompletionTestCase.buildTests('test005', ''' |
| 1883 class A {} | 1881 class A {} |
| 1884 void rr(var vim) { | 1882 void rr(var vim) { |
| 1885 var !1vq = v!2.toString(); | 1883 var !1vq = v!2.toString(); |
| 1886 var vf; | 1884 var vf; |
| 1887 v!3.toString(); | 1885 v!3.toString(); |
| 1888 }''', | 1886 }''', |
| 1889 <String>[ | 1887 <String>[ |
| 1890 "1-A", | 1888 "1-A", |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1942 "7+Aclass", | 1940 "7+Aclass", |
| 1943 "7-Bclass", | 1941 "7-Bclass", |
| 1944 "8+Ctype", | 1942 "8+Ctype", |
| 1945 "9+abstract", | 1943 "9+abstract", |
| 1946 "A+with", | 1944 "A+with", |
| 1947 "B+Eclass", | 1945 "B+Eclass", |
| 1948 "B-Dclass", | 1946 "B-Dclass", |
| 1949 "B-Ctype", | 1947 "B-Ctype", |
| 1950 "C+Bclass", | 1948 "C+Bclass", |
| 1951 "C-Eclass"], | 1949 "C-Eclass"], |
| 1952 failingTests: '12359A'); | 1950 failingTests: '12359AB'); |
| 1953 | 1951 |
| 1954 // keywords | 1952 // keywords |
| 1955 CompletionTestCase.buildTests('test009', ''' | 1953 CompletionTestCase.buildTests('test009', ''' |
| 1956 class num{} | |
| 1957 typedef !1dy!2namic TestFn1(); | 1954 typedef !1dy!2namic TestFn1(); |
| 1958 typedef !3vo!4id TestFn2(); | 1955 typedef !3vo!4id TestFn2(); |
| 1959 typ!7edef !5n!6''', | 1956 typ!7edef !5n!6''', |
| 1960 <String>[ | 1957 <String>[ |
| 1961 "1+void", | 1958 "1+void", |
| 1962 "1+TestFn2", | 1959 "1+TestFn2", |
| 1963 "2+dynamic", | 1960 "2+dynamic", |
| 1964 "2-void", | 1961 "2-void", |
| 1965 "3+dynamic", | 1962 "3+dynamic", |
| 1966 "4+void", | 1963 "4+void", |
| 1967 "4-dynamic", | 1964 "4-dynamic", |
| 1968 "5+TestFn2", | 1965 "5+TestFn2", |
| 1969 "6+num", | 1966 "6+num", |
| 1970 "7+typedef"], | 1967 "7+typedef"], |
| 1971 failingTests: '12347'); | 1968 failingTests: '12347'); |
| 1972 | 1969 |
| 1973 CompletionTestCase.buildTests('test010', ''' | 1970 CompletionTestCase.buildTests('test010', ''' |
| 1974 class String{}class List{} | |
| 1975 class test !8<!1t !2 !3extends String,!4 List,!5 !6>!7 {} | 1971 class test !8<!1t !2 !3extends String,!4 List,!5 !6>!7 {} |
| 1976 class tezetst !9<!BString,!C !DList>!A {}''', | 1972 class tezetst !9<!BString,!C !DList>!A {}''', |
| 1977 <String>[ | 1973 <String>[ |
| 1978 "1+String", | 1974 "1+String", |
| 1979 "1+List", | 1975 "1+List", |
| 1980 "1-test", | 1976 "1-test", |
| 1981 "2-String", | 1977 "2-String", |
| 1982 "2-test", | 1978 "2-test", |
| 1983 "3+extends", | 1979 "3+extends", |
| 1984 "4+tezetst", | 1980 "4+tezetst", |
| 1985 "4-test", | 1981 "4-test", |
| 1986 "5+String", | 1982 "5+String", |
| 1987 "6+List", | 1983 "6+List", |
| 1988 "7-List", | 1984 "7-List", |
| 1989 "8-List", | 1985 "8-List", |
| 1990 "9-String", | 1986 "9-String", |
| 1991 "A-String", | 1987 "A-String", |
| 1992 "B+String", | 1988 "B+String", |
| 1993 "C+List", | 1989 "C+List", |
| 1994 "C-tezetst", | 1990 "C-tezetst", |
| 1995 "D+List", | 1991 "D+List", |
| 1996 "D+test"], | 1992 "D+test"], |
| 1997 failingTests: '3'); | 1993 failingTests: '345C'); |
| 1998 | 1994 |
| 1999 // name generation with conflicts | 1995 // name generation with conflicts |
| 2000 CompletionTestCase.buildTests( | 1996 CompletionTestCase.buildTests( |
| 2001 'test011', | 1997 'test011', |
| 2002 '''r2(var object, Object object1, Object !1);''', | 1998 '''r2(var object, Object object1, Object !1);''', |
| 2003 <String>["1+object2"], | 1999 <String>["1+object2"], |
| 2004 failingTests: '1'); | 2000 failingTests: '1'); |
| 2005 | 2001 |
| 2006 // reserved words | 2002 // reserved words |
| 2007 CompletionTestCase.buildTests('test012', ''' | 2003 CompletionTestCase.buildTests('test012', ''' |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2395 'test_classMembers_inGetter', | 2391 'test_classMembers_inGetter', |
| 2396 '''class A { var fff; get z {ff!1}}''', | 2392 '''class A { var fff; get z {ff!1}}''', |
| 2397 <String>["1+fff"]); | 2393 <String>["1+fff"]); |
| 2398 | 2394 |
| 2399 CompletionTestCase.buildTests( | 2395 CompletionTestCase.buildTests( |
| 2400 'testSingle', | 2396 'testSingle', |
| 2401 '''class A {int x; !2mth() {int y = this.x;}}class B{}''', | 2397 '''class A {int x; !2mth() {int y = this.x;}}class B{}''', |
| 2402 <String>["2+B"]); | 2398 <String>["2+B"]); |
| 2403 } | 2399 } |
| 2404 } | 2400 } |
| OLD | NEW |