Chromium Code Reviews| 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 'package:unittest/unittest.dart'; | |
| 10 | |
| 11 import 'completion_test_support.dart'; | 9 import 'completion_test_support.dart'; |
| 12 | 10 |
| 13 main() { | 11 main() { |
| 14 // CompletionTestBuilder builder = new CompletionTestBuilder(); | 12 CompletionTestBuilder builder = new CompletionTestBuilder(); |
| 15 // builder.buildAll(); | 13 builder.buildAll(); |
| 16 test("dummy", () => null); | |
| 17 } | 14 } |
| 18 | 15 |
| 19 /** | 16 /** |
| 20 * A builder that builds the completion tests. | 17 * A builder that builds the completion tests. |
| 21 */ | 18 */ |
| 22 class CompletionTestBuilder { | 19 class CompletionTestBuilder { |
| 23 void buildAll() { | 20 void buildAll() { |
| 24 buildNumberedTests(); | 21 buildNumberedTests(); |
| 25 buildCommentSnippetTests(); | 22 buildCommentSnippetTests(); |
| 26 buildCompletionTests(); | 23 buildCompletionTests(); |
| 27 buildOtherTests(); | 24 buildOtherTests(); |
| 28 buildLibraryTests(); | 25 buildLibraryTests(); |
| 29 } | 26 } |
| 30 | 27 |
| 31 void buildCommentSnippetTests() { | 28 void buildCommentSnippetTests() { |
| 32 CompletionTestCase.buildTests('testCommentSnippets001', ''' | 29 CompletionTestCase.buildTests('testCommentSnippets001', ''' |
| 33 class X {static final num MAX = 0;num yc,xc;mth() {xc = yc = MA!1X;x!2c.abs();nu m f = M!3AX;}}''', | 30 class X {static final num MAX = 0;num yc,xc;mth() {xc = yc = MA!1X;x!2c.abs();nu m f = M!3AX;}}''', |
| 34 <String>["1+MAX", "2+xc", "3+MAX"]); | 31 <String>["1+MAX", "2+xc", "3+MAX"]); |
| 35 | 32 |
| 36 CompletionTestCase.buildTests('testCommentSnippets002', ''' | 33 CompletionTestCase.buildTests('testCommentSnippets002', ''' |
| 37 class Y {String x='hi';mth() {x.l!1ength;int n = 0;x!2.codeUnitAt(n!3);}}''', | 34 class Y {String x='hi';mth() {x.l!1ength;int n = 0;x!2.codeUnitAt(n!3);}}''', |
| 38 <String>["1+length", "2+x", "3+n"]); | 35 <String>["1+length", "2+x", "3+n"]); |
| 39 | 36 |
| 40 CompletionTestCase.buildTests('testCommentSnippets004', ''' | 37 CompletionTestCase.buildTests('testCommentSnippets004', ''' |
| 41 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{}''', |
| 42 <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 failingTests: '3'); | |
| 43 | 41 |
| 44 CompletionTestCase.buildTests('testCommentSnippets005', ''' | 42 CompletionTestCase.buildTests('testCommentSnippets005', ''' |
| 45 class Date { static Date JUN, JUL;}class X { m() { return Da!1te.JU!2L; }}''', | 43 class Date { static Date JUN, JUL;}class X { m() { return Da!1te.JU!2L; }}''', |
| 46 <String>["1+Date", "2+JUN", "2+JUL"]); | 44 <String>["1+Date", "2+JUN", "2+JUL"]); |
| 47 | 45 |
| 48 CompletionTestCase.buildTests('testCommentSnippets007', ''' | 46 CompletionTestCase.buildTests('testCommentSnippets007', ''' |
| 49 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{}''', | 47 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{}''', |
| 50 <String>["1+bool", "2+bool", "3+int", "4+Arrays"]); | 48 <String>["1+bool", "2+bool", "3+int", "4+Arrays"], failingTests: '3'); |
| 51 | 49 |
| 52 CompletionTestCase.buildTests('testCommentSnippets008', ''' | 50 CompletionTestCase.buildTests('testCommentSnippets008', ''' |
| 53 class Date{}final num M = Dat!1''', <String>["1+Date"]); | 51 class Date{}final num M = Dat!1''', <String>["1+Date"]); |
| 54 | 52 |
| 55 // space, char, eol are important | 53 // space, char, eol are important |
| 56 CompletionTestCase.buildTests('testCommentSnippets009', ''' | 54 CompletionTestCase.buildTests('testCommentSnippets009', ''' |
| 57 class Map{}class Maps{}class x extends!5 !2M!3 !4implements!6 !1\n{}''', | 55 class Map{}class Maps{}class x extends!5 !2M!3 !4implements!6 !1\n{}''', |
| 58 <String>[ | 56 <String>[ |
| 59 "1+Map", | 57 "1+Map", |
| 60 "2+Maps", | 58 "2+Maps", |
| 61 "3+Maps", | 59 "3+Maps", |
| 62 "4-Maps", | 60 "4-Maps", |
| 63 "4+implements", | 61 "4+implements", |
| 64 "5-Maps", | 62 "5-Maps", |
| 65 "6-Map", | 63 "6-Map", |
| 66 "6+implements"]); | 64 "6+implements"], |
| 65 failingTests: '46'); | |
| 67 | 66 |
| 68 // space, char, eol are important | 67 // space, char, eol are important |
| 69 CompletionTestCase.buildTests('testCommentSnippets010', ''' | 68 CompletionTestCase.buildTests('testCommentSnippets010', ''' |
| 70 class Map{}class x implements !1{}''', <String>["1+Map"]); | 69 class Map{}class x implements !1{}''', <String>["1+Map"], failingTests: '1'); |
| 71 | 70 |
| 72 // space, char, eol are important | 71 // space, char, eol are important |
| 73 CompletionTestCase.buildTests('testCommentSnippets011', ''' | 72 CompletionTestCase.buildTests('testCommentSnippets011', ''' |
| 74 class Map{}class x implements M!1{}''', <String>["1+Map"]); | 73 class Map{}class x implements M!1{}''', <String>["1+Map"], failingTests: '1'); |
| 75 | 74 |
| 76 // space, char, eol are important | 75 // space, char, eol are important |
| 77 CompletionTestCase.buildTests('testCommentSnippets012', ''' | 76 CompletionTestCase.buildTests('testCommentSnippets012', ''' |
| 78 class Map{}class x implements M!1\n{}''', <String>["1+Map"]); | 77 class Map{}class x implements M!1\n{}''', <String>["1+Map"], failingTests: '1'); |
| 79 | 78 |
| 80 CompletionTestCase.buildTests('testCommentSnippets013', ''' | 79 CompletionTestCase.buildTests('testCommentSnippets013', ''' |
| 81 class num{}class x !2{!1}!3''', <String>["1+num", "2-num", "3-num"]); | 80 class num{}class x !2{!1}!3''', |
| 81 <String>["1+num", "2-num", "3-num"], | |
| 82 failingTests: '1'); | |
| 82 | 83 |
| 83 // trailing space is important | 84 // trailing space is important |
| 84 CompletionTestCase.buildTests('testCommentSnippets014', ''' | 85 CompletionTestCase.buildTests('testCommentSnippets014', ''' |
| 85 class num{}typedef n!1 ;''', <String>["1+num"]); | 86 class num{}typedef n!1 ;''', <String>["1+num"]); |
| 86 | 87 |
| 87 CompletionTestCase.buildTests('testCommentSnippets015', ''' | 88 CompletionTestCase.buildTests('testCommentSnippets015', ''' |
| 88 class D {f(){} g(){f!1(f!2);}}''', <String>["1+f", "2+f"]); | 89 class D {f(){} g(){f!1(f!2);}}''', <String>["1+f", "2+f"]); |
| 89 | 90 |
| 90 CompletionTestCase.buildTests('testCommentSnippets016', ''' | 91 CompletionTestCase.buildTests('testCommentSnippets016', ''' |
| 91 class F {m() { m(); !1}}''', <String>["1+m"]); | 92 class F {m() { m(); !1}}''', <String>["1+m"]); |
| 92 | 93 |
| 93 CompletionTestCase.buildTests('testCommentSnippets017', ''' | 94 CompletionTestCase.buildTests('testCommentSnippets017', ''' |
| 94 class F {var x = !1false;}''', <String>["1+true"]); | 95 class F {var x = !1false;}''', <String>["1+true"], failingTests: '1'); |
| 95 | 96 |
| 96 CompletionTestCase.buildTests('testCommentSnippets018', ''' | 97 CompletionTestCase.buildTests('testCommentSnippets018', ''' |
| 97 class Map{}class Arrays{}class C{ m(!1){} n(!2 x, q)''', | 98 class Map{}class Arrays{}class C{ m(!1){} n(!2 x, q)''', |
| 98 <String>["1+Map", "1-void", "1-null", "2+Arrays", "2-void", "2-null"]); | 99 <String>["1+Map", "1-void", "1-null", "2+Arrays", "2-void", "2-null"], |
| 100 failingTests: '1'); | |
| 99 | 101 |
| 100 CompletionTestCase.buildTests('testCommentSnippets019', ''' | 102 CompletionTestCase.buildTests('testCommentSnippets019', ''' |
| 101 class A{m(){Object x;x.!1/**/clear()''', <String>["1+toString"]); | 103 class A{m(){Object x;x.!1/**/clear()''', |
| 104 <String>["1+toString"], | |
| 105 failingTests: '1'); | |
| 102 | 106 |
| 103 CompletionTestCase.buildTests('testCommentSnippets020', ''' | 107 CompletionTestCase.buildTests('testCommentSnippets020', ''' |
| 104 classMap{}class tst {var newt;void newf(){}test() {var newz;new!1/**/;}}''', | 108 classMap{}class tst {var newt;void newf(){}test() {var newz;new!1/**/;}}''', |
| 105 <String>["1+newt", "1+newf", "1+newz", "1-Map"]); | 109 <String>["1+newt", "1+newf", "1+newz", "1-Map"], |
| 110 failingTests: '1'); | |
| 106 | 111 |
| 107 CompletionTestCase.buildTests('testCommentSnippets021', ''' | 112 CompletionTestCase.buildTests('testCommentSnippets021', ''' |
| 108 class Map{}class tst {var newt;void newf(){}test() {var newz;new !1/**/;}}''', | 113 class Map{}class tst {var newt;void newf(){}test() {var newz;new !1/**/;}}''', |
| 109 <String>["1+Map", "1-newt"]); | 114 <String>["1+Map", "1-newt"], |
| 115 failingTests: '1'); | |
| 110 | 116 |
| 111 CompletionTestCase.buildTests('testCommentSnippets022', ''' | 117 CompletionTestCase.buildTests('testCommentSnippets022', ''' |
| 112 class Map{}class F{m(){new !1;}}''', <String>["1+Map"]); | 118 class Map{}class F{m(){new !1;}}''', <String>["1+Map"], failingTests: '1'); |
| 113 | 119 |
| 114 CompletionTestCase.buildTests('testCommentSnippets022a', ''' | 120 CompletionTestCase.buildTests('testCommentSnippets022a', ''' |
| 115 class Map{}class F{m(){new !1''', <String>["1+Map"]); | 121 class Map{}class F{m(){new !1''', <String>["1+Map"], failingTests: '1'); |
| 116 | 122 |
| 117 CompletionTestCase.buildTests('testCommentSnippets022b', ''' | 123 CompletionTestCase.buildTests('testCommentSnippets022b', ''' |
| 118 class Map{factory Map.qq(){return null;}}class F{m(){new Map.!1qq();}}''', | 124 class Map{factory Map.qq(){return null;}}class F{m(){new Map.!1qq();}}''', |
| 119 <String>["1+qq"]); | 125 <String>["1+qq"], |
| 126 failingTests: '1'); | |
| 120 | 127 |
| 121 CompletionTestCase.buildTests('testCommentSnippets023', ''' | 128 CompletionTestCase.buildTests('testCommentSnippets023', ''' |
| 122 class X {X c; X(this.!1c!3) : super() {c.!2}}''', | 129 class X {X c; X(this.!1c!3) : super() {c.!2}}''', |
| 123 <String>["1+c", "2+c", "3+c"]); | 130 <String>["1+c", "2+c", "3+c"]); |
| 124 | 131 |
| 125 CompletionTestCase.buildTests('testCommentSnippets024', ''' | 132 CompletionTestCase.buildTests('testCommentSnippets024', ''' |
| 126 class q {m(Map q){var x;m(!1)}n(){var x;n(!2)}}''', <String>["1+x", "2+x"]); | 133 class q {m(Map q){var x;m(!1)}n(){var x;n(!2)}}''', <String>["1+x", "2+x"]); |
| 127 | 134 |
| 128 CompletionTestCase.buildTests('testCommentSnippets025', ''' | 135 CompletionTestCase.buildTests('testCommentSnippets025', ''' |
| 129 class q {num m() {var q; num x=!1 q!3 + !2/**/;}}''', | 136 class q {num m() {var q; num x=!1 q!3 + !2/**/;}}''', |
| 130 <String>["1+q", "2+q", "3+q"]); | 137 <String>["1+q", "2+q", "3+q"], |
| 138 failingTests: '123'); | |
| 131 | 139 |
| 132 CompletionTestCase.buildTests('testCommentSnippets026', ''' | 140 CompletionTestCase.buildTests('testCommentSnippets026', ''' |
| 133 class List{}class a implements !1{}''', <String>["1+List"]); | 141 class List{}class a implements !1{}''', <String>["1+List"], failingTests: '1'); |
| 134 | 142 |
| 135 CompletionTestCase.buildTests('testCommentSnippets027', ''' | 143 CompletionTestCase.buildTests('testCommentSnippets027', ''' |
| 136 class String{}class List{}class test <X extends !1String!2> {}''', | 144 class String{}class List{}class test <X extends !1String!2> {}''', |
| 137 <String>["1+List", "2+String", "2-List"]); | 145 <String>["1+List", "2+String", "2-List"], |
| 146 failingTests: '12'); | |
| 138 | 147 |
| 139 CompletionTestCase.buildTests('testCommentSnippets028', ''' | 148 CompletionTestCase.buildTests('testCommentSnippets028', ''' |
| 140 class String{}class List{}class DateTime{}typedef T Y<T extends !1>(List input); ''', | 149 class String{}class List{}class DateTime{}typedef T Y<T extends !1>(List input); ''', |
| 141 <String>["1+DateTime", "1+String"]); | 150 <String>["1+DateTime", "1+String"], |
| 151 failingTests: '1'); | |
| 142 | 152 |
| 143 CompletionTestCase.buildTests('testCommentSnippets029', ''' | 153 CompletionTestCase.buildTests('testCommentSnippets029', ''' |
| 144 interface A<X> default B<X extends !1List!2> {}''', | 154 interface A<X> default B<X extends !1List!2> {}''', |
| 145 <String>["1+DateTime", "2+List"]); | 155 <String>["1+DateTime", "2+List"]); |
| 146 | 156 |
| 147 CompletionTestCase.buildTests('testCommentSnippets030', ''' | 157 CompletionTestCase.buildTests('testCommentSnippets030', ''' |
| 148 class Bar<T extends Foo> {const Bar(!1T!2 k);T!3 m(T!4 a, T!5 b){}final T!6 f = null;}''', | 158 class Bar<T extends Foo> {const Bar(!1T!2 k);T!3 m(T!4 a, T!5 b){}final T!6 f = null;}''', |
| 149 <String>["1+T", "2+T", "3+T", "4+T", "5+T", "6+T"]); | 159 <String>["1+T", "2+T", "3+T", "4+T", "5+T", "6+T"], |
| 160 failingTests: '123456'); | |
| 150 | 161 |
| 151 CompletionTestCase.buildTests('testCommentSnippets031', ''' | 162 CompletionTestCase.buildTests('testCommentSnippets031', ''' |
| 152 class Bar<T extends Foo> {m(x){if (x is !1) return;if (x is!!!2)}}''', | 163 class Bar<T extends Foo> {m(x){if (x is !1) return;if (x is!!!2)}}''', |
| 153 <String>["1+Bar", "1+T", "2+T", "2+Bar"]); | 164 <String>["1+Bar", "1+T", "2+T", "2+Bar"], |
| 165 failingTests: '12'); | |
| 154 | 166 |
| 155 CompletionTestCase.buildTests('testCommentSnippets032', ''' | 167 CompletionTestCase.buildTests('testCommentSnippets032', ''' |
| 156 class Fit{}class Bar<T extends Fooa> {const F!1ara();}''', | 168 class Fit{}class Bar<T extends Fooa> {const F!1ara();}''', |
| 157 <String>["1+Fit", "1+Fara", "1-Bar"]); | 169 <String>["1+Fit", "1+Fara", "1-Bar"]); |
| 158 | 170 |
| 159 // Type propagation | 171 // Type propagation |
| 160 CompletionTestCase.buildTests('testCommentSnippets033', ''' | 172 CompletionTestCase.buildTests('testCommentSnippets033', ''' |
| 161 class List{add(){}length(){}}t1() {var x;if (x is List) {x.!1add(3);}}''', | 173 class List{add(){}length(){}}t1() {var x;if (x is List) {x.!1add(3);}}''', |
| 162 <String>["1+add", "1+length"]); | 174 <String>["1+add", "1+length"]); |
| 163 | 175 |
| 164 // Type propagation | 176 // Type propagation |
| 165 CompletionTestCase.buildTests('testCommentSnippets035', ''' | 177 CompletionTestCase.buildTests('testCommentSnippets035', ''' |
| 166 class List{clear(){}length(){}}t3() {var x=new List(), y=x.!1length();x.!2clear( );}''', | 178 class List{clear(){}length(){}}t3() {var x=new List(), y=x.!1length();x.!2clear( );}''', |
| 167 <String>["1+length", "2+clear"]); | 179 <String>["1+length", "2+clear"]); |
| 168 | 180 |
| 169 CompletionTestCase.buildTests('testCommentSnippets036', ''' | 181 CompletionTestCase.buildTests('testCommentSnippets036', ''' |
| 170 class List{}t3() {var x=new List!1}''', <String>["1+List"]); | 182 class List{}t3() {var x=new List!1}''', <String>["1+List"], failingTests: '1'); |
| 171 | 183 |
| 172 CompletionTestCase.buildTests('testCommentSnippets037', ''' | 184 CompletionTestCase.buildTests('testCommentSnippets037', ''' |
| 173 class List{factory List.from(){}}t3() {var x=new List.!1}''', | 185 class List{factory List.from(){}}t3() {var x=new List.!1}''', |
| 174 <String>["1+from"]); | 186 <String>["1+from"], |
| 187 failingTests: '1'); | |
| 175 | 188 |
| 176 CompletionTestCase.buildTests('testCommentSnippets038', ''' | 189 CompletionTestCase.buildTests('testCommentSnippets038', ''' |
| 177 f(){int xa; String s = '\$x!1';}''', <String>["1+xa"]); | 190 f(){int xa; String s = '\$x!1';}''', <String>["1+xa"]); |
| 178 | 191 |
| 179 CompletionTestCase.buildTests('testCommentSnippets038a', ''' | 192 CompletionTestCase.buildTests('testCommentSnippets038a', ''' |
| 180 int xa; String s = '\$x!1\'''', <String>["1+xa"]); | 193 int xa; String s = '\$x!1\'''', <String>["1+xa"]); |
| 181 | 194 |
| 182 CompletionTestCase.buildTests('testCommentSnippets039', ''' | 195 CompletionTestCase.buildTests('testCommentSnippets039', ''' |
| 183 f(){int xa; String s = '\$!1';}''', <String>["1+xa"]); | 196 f(){int xa; String s = '\$!1';}''', <String>["1+xa"]); |
| 184 | 197 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 195 | 208 |
| 196 CompletionTestCase.buildTests('testCommentSnippets042', ''' | 209 CompletionTestCase.buildTests('testCommentSnippets042', ''' |
| 197 class DateTime{static const int WED=3;int get day;}fd(){DateTime d=new DateTime. now();d.!1WED!2;}''', | 210 class DateTime{static const int WED=3;int get day;}fd(){DateTime d=new DateTime. now();d.!1WED!2;}''', |
| 198 <String>["1+day", "2-WED"]); | 211 <String>["1+day", "2-WED"]); |
| 199 | 212 |
| 200 CompletionTestCase.buildTests('testCommentSnippets043', ''' | 213 CompletionTestCase.buildTests('testCommentSnippets043', ''' |
| 201 class L{var k;void.!1}''', <String>["1-k"]); | 214 class L{var k;void.!1}''', <String>["1-k"]); |
| 202 | 215 |
| 203 CompletionTestCase.buildTests('testCommentSnippets044', ''' | 216 CompletionTestCase.buildTests('testCommentSnippets044', ''' |
| 204 class List{}class XXX {XXX.fisk();}main() {main(); new !1}}''', | 217 class List{}class XXX {XXX.fisk();}main() {main(); new !1}}''', |
| 205 <String>["1+List", "1+XXX.fisk"]); | 218 <String>["1+List", "1+XXX.fisk"], |
| 219 failingTests: '1'); | |
| 206 | 220 |
| 207 CompletionTestCase.buildTests('testCommentSnippets047', ''' | 221 CompletionTestCase.buildTests('testCommentSnippets047', ''' |
| 208 f(){int x;int y=!1;}''', <String>["1+x"]); | 222 f(){int x;int y=!1;}''', <String>["1+x"]); |
| 209 | 223 |
| 210 CompletionTestCase.buildTests('testCommentSnippets048', ''' | 224 CompletionTestCase.buildTests('testCommentSnippets048', ''' |
| 211 import 'dart:convert' as json;f() {var x=new js!1}''', <String>["1+json"]); | 225 import 'dart:convert' as json;f() {var x=new js!1}''', |
| 226 <String>["1+json"], | |
| 227 failingTests: '1'); | |
| 212 | 228 |
| 213 CompletionTestCase.buildTests('testCommentSnippets049', ''' | 229 CompletionTestCase.buildTests('testCommentSnippets049', ''' |
| 214 import 'dart:convert' as json; | 230 import 'dart:convert' as json; |
| 215 import 'dart:convert' as jxx; | 231 import 'dart:convert' as jxx; |
| 216 class JsonParserX{} | 232 class JsonParserX{} |
| 217 f1() {var x=new !2j!1s!3}''', | 233 f1() {var x=new !2j!1s!3}''', |
| 218 <String>[ | 234 <String>[ |
| 219 "1+json", | 235 "1+json", |
| 220 "1+jxx", | 236 "1+jxx", |
| 221 "2+json", | 237 "2+json", |
| 222 "2+jxx", | 238 "2+jxx", |
| 223 "2-JsonParser", | 239 "2-JsonParser", |
| 224 "3+json", | 240 "3+json", |
| 225 "3-jxx"]); | 241 "3-jxx"], |
| 242 failingTests: '123'); | |
| 226 | 243 |
| 227 CompletionTestCase.buildTests('testCommentSnippets050', ''' | 244 CompletionTestCase.buildTests('testCommentSnippets050', ''' |
| 228 class xdr { | 245 class xdr { |
| 229 xdr(); | 246 xdr(); |
| 230 const xdr.a(a,b,c); | 247 const xdr.a(a,b,c); |
| 231 xdr.b(); | 248 xdr.b(); |
| 232 f() => 3; | 249 f() => 3; |
| 233 } | 250 } |
| 234 class xa{} | 251 class xa{} |
| 235 k() { | 252 k() { |
| 236 new x!1dr().f(); | 253 new x!1dr().f(); |
| 237 const x!2dr.!3a(1, 2, 3); | 254 const x!2dr.!3a(1, 2, 3); |
| 238 }''', | 255 }''', |
| 239 <String>[ | 256 <String>[ |
| 240 "1+xdr", | 257 "1+xdr", |
| 241 "1+xa", | 258 "1+xa", |
| 242 "1+xdr.a", | 259 "1+xdr.a", |
| 243 "1+xdr.b", | 260 "1+xdr.b", |
| 244 "2-xa", | 261 "2-xa", |
| 245 "2-xdr", | 262 "2-xdr", |
| 246 "2+xdr.a", | 263 "2+xdr.a", |
| 247 "2-xdr.b", | 264 "2-xdr.b", |
| 248 "3-b", | 265 "3-b", |
| 249 "3+a"]); | 266 "3+a"], |
| 267 failingTests: '123'); | |
| 250 | 268 |
| 251 // Type propagation. | 269 // Type propagation. |
| 252 CompletionTestCase.buildTests('testCommentSnippets051', ''' | 270 CompletionTestCase.buildTests('testCommentSnippets051', ''' |
| 253 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} | 271 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} |
| 254 void r() { | 272 void r() { |
| 255 var v; | 273 var v; |
| 256 if (v is String) { | 274 if (v is String) { |
| 257 v.!1length; | 275 v.!1length; |
| 258 v.!2getKeys; | 276 v.!2getKeys; |
| 259 } | 277 } |
| 260 }''', <String>["1+length", "2-getKeys"]); | 278 }''', <String>["1+length", "2-getKeys"], failingTests: '1'); |
| 261 | 279 |
| 262 // Type propagation. | 280 // Type propagation. |
| 263 CompletionTestCase.buildTests('testCommentSnippets052', ''' | 281 CompletionTestCase.buildTests('testCommentSnippets052', ''' |
| 264 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} | 282 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} |
| 265 void r() { | 283 void r() { |
| 266 List<String> values = ['a','b','c']; | 284 List<String> values = ['a','b','c']; |
| 267 for (var v in values) { | 285 for (var v in values) { |
| 268 v.!1toUpperCase; | 286 v.!1toUpperCase; |
| 269 v.!2getKeys; | 287 v.!2getKeys; |
| 270 } | 288 } |
| 271 }''', <String>["1+toUpperCase", "2-getKeys"]); | 289 }''', <String>["1+toUpperCase", "2-getKeys"], failingTests: '1'); |
| 272 | 290 |
| 273 // Type propagation. | 291 // Type propagation. |
| 274 CompletionTestCase.buildTests('testCommentSnippets053', ''' | 292 CompletionTestCase.buildTests('testCommentSnippets053', ''' |
| 275 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} | 293 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} |
| 276 void r() { | 294 void r() { |
| 277 var v; | 295 var v; |
| 278 while (v is String) { | 296 while (v is String) { |
| 279 v.!1toUpperCase; | 297 v.!1toUpperCase; |
| 280 v.!2getKeys; | 298 v.!2getKeys; |
| 281 } | 299 } |
| 282 }''', <String>["1+toUpperCase", "2-getKeys"]); | 300 }''', <String>["1+toUpperCase", "2-getKeys"], failingTests: '1'); |
| 283 | 301 |
| 284 CompletionTestCase.buildTests('testCommentSnippets054', ''' | 302 CompletionTestCase.buildTests('testCommentSnippets054', ''' |
| 285 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} | 303 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} |
| 286 void r() { | 304 void r() { |
| 287 var v; | 305 var v; |
| 288 for (; v is String; v.!1isEmpty) { | 306 for (; v is String; v.!1isEmpty) { |
| 289 v.!2toUpperCase; | 307 v.!2toUpperCase; |
| 290 v.!3getKeys; | 308 v.!3getKeys; |
| 291 } | 309 } |
| 292 }''', <String>["1+isEmpty", "2+toUpperCase", "3-getKeys"]); | 310 }''', <String>["1+isEmpty", "2+toUpperCase", "3-getKeys"], failingTests: '12'); |
| 293 | 311 |
| 294 CompletionTestCase.buildTests('testCommentSnippets055', ''' | 312 CompletionTestCase.buildTests('testCommentSnippets055', ''' |
| 295 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} | 313 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} |
| 296 void r() { | 314 void r() { |
| 297 String v; | 315 String v; |
| 298 if (v is Object) { | 316 if (v is Object) { |
| 299 v.!1toUpperCase; | 317 v.!1toUpperCase; |
| 300 } | 318 } |
| 301 }''', <String>["1+toUpperCase"]); | 319 }''', <String>["1+toUpperCase"]); |
| 302 | 320 |
| 303 // Type propagation. | 321 // Type propagation. |
| 304 CompletionTestCase.buildTests('testCommentSnippets056', ''' | 322 CompletionTestCase.buildTests('testCommentSnippets056', ''' |
| 305 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} | 323 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} |
| 306 void f(var v) { | 324 void f(var v) { |
| 307 if (v is!! String) { | 325 if (v is!! String) { |
| 308 return; | 326 return; |
| 309 } | 327 } |
| 310 v.!1toUpperCase; | 328 v.!1toUpperCase; |
| 311 }''', <String>["1+toUpperCase"]); | 329 }''', <String>["1+toUpperCase"], failingTests: '1'); |
| 312 | 330 |
| 313 // Type propagation. | 331 // Type propagation. |
| 314 CompletionTestCase.buildTests('testCommentSnippets057', ''' | 332 CompletionTestCase.buildTests('testCommentSnippets057', ''' |
| 315 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} | 333 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} |
| 316 void f(var v) { | 334 void f(var v) { |
| 317 if ((v as String).length == 0) { | 335 if ((v as String).length == 0) { |
| 318 v.!1toUpperCase; | 336 v.!1toUpperCase; |
| 319 } | 337 } |
| 320 }''', <String>["1+toUpperCase"]); | 338 }''', <String>["1+toUpperCase"], failingTests: '1'); |
| 321 | 339 |
| 322 CompletionTestCase.buildTests('testCommentSnippets058', ''' | 340 CompletionTestCase.buildTests('testCommentSnippets058', ''' |
| 323 typedef vo!2id callback(int k); | 341 typedef vo!2id callback(int k); |
| 324 void x(callback q){} | 342 void x(callback q){} |
| 325 void r() { | 343 void r() { |
| 326 callback v; | 344 callback v; |
| 327 x(!1); | 345 x(!1); |
| 328 }''', <String>["1+v", "2+void"]); | 346 }''', <String>["1+v", "2+void"], failingTests: '2'); |
| 329 | 347 |
| 330 CompletionTestCase.buildTests('testCommentSnippets059', ''' | 348 CompletionTestCase.buildTests('testCommentSnippets059', ''' |
| 331 f(){((int x) => x+4).!1call(1);}''', <String>["1-call"]); | 349 f(){((int x) => x+4).!1call(1);}''', <String>["1-call"]); |
| 332 | 350 |
| 333 CompletionTestCase.buildTests('testCommentSnippets060', ''' | 351 CompletionTestCase.buildTests('testCommentSnippets060', ''' |
| 334 class Map{} | 352 class Map{} |
| 335 abstract class MM extends Map{factory MM() => new Map();} | 353 abstract class MM extends Map{factory MM() => new Map();} |
| 336 class Z { | 354 class Z { |
| 337 MM x; | 355 MM x; |
| 338 f() { | 356 f() { |
| 339 x!1 | 357 x!1 |
| 340 } | 358 } |
| 341 }''', <String>["1+x", "1-x[]"]); | 359 }''', <String>["1+x", "1-x[]"]); |
| 342 | 360 |
| 343 CompletionTestCase.buildTests('testCommentSnippets061', ''' | 361 CompletionTestCase.buildTests('testCommentSnippets061', ''' |
| 344 class A{m(){!1f(3);!2}}n(){!3f(3);!4}f(x)=>x*3;''', | 362 class A{m(){!1f(3);!2}}n(){!3f(3);!4}f(x)=>x*3;''', |
| 345 <String>["1+f", "1+n", "2+f", "2+n", "3+f", "3+n", "4+f", "4+n"]); | 363 <String>["1+f", "1+n", "2+f", "2+n", "3+f", "3+n", "4+f", "4+n"]); |
| 346 | 364 |
| 347 // Type propagation. | 365 // Type propagation. |
| 348 CompletionTestCase.buildTests('testCommentSnippets063', ''' | 366 CompletionTestCase.buildTests('testCommentSnippets063', ''' |
| 349 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} | 367 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} |
| 350 void r(var v) { | 368 void r(var v) { |
| 351 v.!1toUpperCase; | 369 v.!1toUpperCase; |
| 352 assert(v is String); | 370 assert(v is String); |
| 353 v.!2toUpperCase; | 371 v.!2toUpperCase; |
| 354 }''', <String>["1-toUpperCase", "2+toUpperCase"]); | 372 }''', <String>["1-toUpperCase", "2+toUpperCase"], failingTests: '2'); |
| 355 | 373 |
| 356 CompletionTestCase.buildTests('testCommentSnippets064', ''' | 374 CompletionTestCase.buildTests('testCommentSnippets064', ''' |
| 357 class Spline { | 375 class Spline { |
| 358 Line c; | 376 Line c; |
| 359 Spline a() { | 377 Spline a() { |
| 360 return this; | 378 return this; |
| 361 } | 379 } |
| 362 Line b() { | 380 Line b() { |
| 363 return null; | 381 return null; |
| 364 } | 382 } |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 561 _x!1 | 579 _x!1 |
| 562 } | 580 } |
| 563 _x1(){} | 581 _x1(){} |
| 564 }''', <String>["1+_x1"]); | 582 }''', <String>["1+_x1"]); |
| 565 | 583 |
| 566 CompletionTestCase.buildTests('testCommentSnippets075', ''' | 584 CompletionTestCase.buildTests('testCommentSnippets075', ''' |
| 567 p(x)=>0;var E;f(q)=>!1p(!2E);''', <String>["1+p", "2+E"]); | 585 p(x)=>0;var E;f(q)=>!1p(!2E);''', <String>["1+p", "2+E"]); |
| 568 | 586 |
| 569 CompletionTestCase.buildTests('testCommentSnippets076', ''' | 587 CompletionTestCase.buildTests('testCommentSnippets076', ''' |
| 570 class Map<K,V>{}class List<E>{}class int{}main() {var m=new Map<Lis!1t<Map<int,i n!2t>>,List<!3int>>();}''', | 588 class Map<K,V>{}class List<E>{}class int{}main() {var m=new Map<Lis!1t<Map<int,i n!2t>>,List<!3int>>();}''', |
| 571 <String>["1+List", "2+int", "3+int"]); | 589 <String>["1+List", "2+int", "3+int"], |
| 590 failingTests: '123'); | |
| 572 | 591 |
| 573 CompletionTestCase.buildTests('testCommentSnippets076a', ''' | 592 CompletionTestCase.buildTests('testCommentSnippets076a', ''' |
| 574 class Map<K,V>{}class List<E>{}class int{}main() {var m=new Map<Lis!1t<Map<int,i n!2t>>,List<!3>>();}''', | 593 class Map<K,V>{}class List<E>{}class int{}main() {var m=new Map<Lis!1t<Map<int,i n!2t>>,List<!3>>();}''', |
| 575 <String>["1+List", "2+int", "3+int"]); | 594 <String>["1+List", "2+int", "3+int"], |
| 595 failingTests: '123'); | |
| 576 | 596 |
| 577 CompletionTestCase.buildTests('testCommentSnippets077', ''' | 597 CompletionTestCase.buildTests('testCommentSnippets077', ''' |
| 578 class FileMode { | 598 class FileMode { |
| 579 static const READ = const FileMode._internal(0); | 599 static const READ = const FileMode._internal(0); |
| 580 static const WRITE = const FileMode._internal(1); | 600 static const WRITE = const FileMode._internal(1); |
| 581 static const APPEND = const FileMode._internal(2); | 601 static const APPEND = const FileMode._internal(2); |
| 582 const FileMode._internal(int this._mode); | 602 const FileMode._internal(int this._mode); |
| 583 factory FileMode._internal1(int this._mode); | 603 factory FileMode._internal1(int this._mode); |
| 584 factory FileMode(_mode); | 604 factory FileMode(_mode); |
| 585 final int _mode; | 605 final int _mode; |
| 586 } | 606 } |
| 587 class File { | 607 class File { |
| 588 factory File(String path) => null; | 608 factory File(String path) => null; |
| 589 factory File.fromPath(Path path) => null; | 609 factory File.fromPath(Path path) => null; |
| 590 } | 610 } |
| 591 f() => new Fil!1''', | 611 f() => new Fil!1''', |
| 592 <String>[ | 612 <String>[ |
| 593 "1+File", | 613 "1+File", |
| 594 "1+File.fromPath", | 614 "1+File.fromPath", |
| 595 "1+FileMode", | 615 "1+FileMode", |
| 596 "1+FileMode._internal1", | 616 "1+FileMode._internal1", |
| 597 "1+FileMode._internal"]); | 617 "1+FileMode._internal"], |
| 618 failingTests: '1'); | |
| 598 | 619 |
| 599 CompletionTestCase.buildTests('testCommentSnippets078', ''' | 620 CompletionTestCase.buildTests('testCommentSnippets078', ''' |
| 600 class Map{static from()=>null;clear(){}}void main() { Map.!1 }''', | 621 class Map{static from()=>null;clear(){}}void main() { Map.!1 }''', |
| 601 <String>["1+from", "1-clear"]); // static method, instance method | 622 <String>["1+from", "1-clear"]); // static method, instance method |
| 602 | 623 |
| 603 CompletionTestCase.buildTests('testCommentSnippets079', ''' | 624 CompletionTestCase.buildTests('testCommentSnippets079', ''' |
| 604 class Map{static from()=>null;clear(){}}void main() { Map s; s.!1 }''', | 625 class Map{static from()=>null;clear(){}}void main() { Map s; s.!1 }''', |
| 605 <String>["1-from", "1+clear"]); // static method, instance method | 626 <String>["1-from", "1+clear"]); // static method, instance method |
| 606 | 627 |
| 607 CompletionTestCase.buildTests('testCommentSnippets080', ''' | 628 CompletionTestCase.buildTests('testCommentSnippets080', ''' |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 618 var v = (HttpRequest req, HttpResp!1) | 639 var v = (HttpRequest req, HttpResp!1) |
| 619 }''', <String>["1+HttpResponse"]); | 640 }''', <String>["1+HttpResponse"]); |
| 620 | 641 |
| 621 CompletionTestCase.buildTests('testCommentSnippets083', ''' | 642 CompletionTestCase.buildTests('testCommentSnippets083', ''' |
| 622 main() {(.!1)}''', <String>["1-toString"]); | 643 main() {(.!1)}''', <String>["1-toString"]); |
| 623 | 644 |
| 624 CompletionTestCase.buildTests('testCommentSnippets083a', ''' | 645 CompletionTestCase.buildTests('testCommentSnippets083a', ''' |
| 625 main() { .!1 }''', <String>["1-toString"]); | 646 main() { .!1 }''', <String>["1-toString"]); |
| 626 | 647 |
| 627 CompletionTestCase.buildTests('testCommentSnippets083b', ''' | 648 CompletionTestCase.buildTests('testCommentSnippets083b', ''' |
| 628 main() { null.!1 }''', <String>["1+toString"]); | 649 main() { null.!1 }''', <String>["1+toString"], failingTests: '1'); |
| 629 | 650 |
| 630 CompletionTestCase.buildTests('testCommentSnippets084', ''' | 651 CompletionTestCase.buildTests('testCommentSnippets084', ''' |
| 631 class List{}class Map{}typedef X = !1Lis!2t with !3Ma!4p;''', | 652 class List{}class Map{}typedef X = !1Lis!2t with !3Ma!4p;''', |
| 632 <String>["1+Map", "2+List", "2-Map", "3+List", "4+Map", "4-List"]); | 653 <String>["1+Map", "2+List", "2-Map", "3+List", "4+Map", "4-List"], |
| 654 failingTests: '1234'); | |
| 633 | 655 |
| 634 CompletionTestCase.buildTests('testCommentSnippets085', ''' | 656 CompletionTestCase.buildTests('testCommentSnippets085', ''' |
| 635 class List{}class Map{}class Z extends List with !1Ma!2p {}''', | 657 class List{}class Map{}class Z extends List with !1Ma!2p {}''', |
| 636 <String>["1+List", "1+Map", "2+Map", "2-List"]); | 658 <String>["1+List", "1+Map", "2+Map", "2-List"], |
| 659 failingTests: '12'); | |
| 637 | 660 |
| 638 CompletionTestCase.buildTests('testCommentSnippets086', ''' | 661 CompletionTestCase.buildTests('testCommentSnippets086', ''' |
| 639 class Q{f(){xy() {!2};x!1y();}}''', <String>["1+xy", "2+f", "2-xy"]); | 662 class Q{f(){xy() {!2};x!1y();}}''', |
| 663 <String>["1+xy", "2+f", "2-xy"], | |
| 664 failingTests: '1'); | |
| 640 | 665 |
| 641 CompletionTestCase.buildTests('testCommentSnippets087', ''' | 666 CompletionTestCase.buildTests('testCommentSnippets087', ''' |
| 642 class Map{}class Q extends Object with !1Map {}''', | 667 class Map{}class Q extends Object with !1Map {}''', |
| 643 <String>["1+Map", "1-HashMap"]); | 668 <String>["1+Map", "1-HashMap"], |
| 669 failingTests: '1'); | |
| 644 | 670 |
| 645 CompletionTestCase.buildTests('testCommentSnippets088', ''' | 671 CompletionTestCase.buildTests('testCommentSnippets088', ''' |
| 646 class A { | 672 class A { |
| 647 int f; | 673 int f; |
| 648 B m(){} | 674 B m(){} |
| 649 } | 675 } |
| 650 class B extends A { | 676 class B extends A { |
| 651 num f; | 677 num f; |
| 652 A m(){} | 678 A m(){} |
| 653 } | 679 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 698 "4+fqi", | 724 "4+fqi", |
| 699 "4+Q", | 725 "4+Q", |
| 700 "4+xya", | 726 "4+xya", |
| 701 "4-xyb", | 727 "4-xyb", |
| 702 "4+xza", | 728 "4+xza", |
| 703 "5+fqe", | 729 "5+fqe", |
| 704 "5+fqi", | 730 "5+fqi", |
| 705 "5+Q", | 731 "5+Q", |
| 706 "5-xya", | 732 "5-xya", |
| 707 "5-xyb", | 733 "5-xyb", |
| 708 "5-xza"]); | 734 "5-xza"], |
| 735 failingTests: '34'); | |
| 709 | 736 |
| 710 CompletionTestCase.buildTests('testCommentSnippets090', ''' | 737 CompletionTestCase.buildTests('testCommentSnippets090', ''' |
| 711 class X { f() { var a = 'x'; a.!1 }}''', <String>["1+length"]); | 738 class X { f() { var a = 'x'; a.!1 }}''', |
| 739 <String>["1+length"], | |
| 740 failingTests: '1'); | |
| 712 } | 741 } |
| 713 | 742 |
| 714 void buildCompletionTests() { | 743 void buildCompletionTests() { |
| 715 CompletionTestCase.buildTests('testCompletion_alias_field', ''' | 744 CompletionTestCase.buildTests('testCompletion_alias_field', ''' |
| 716 typedef int fnint(int k); fn!1int x;''', <String>["1+fnint"]); | 745 typedef int fnint(int k); fn!1int x;''', <String>["1+fnint"]); |
| 717 | 746 |
| 718 CompletionTestCase.buildTests('testCompletion_annotation_argumentList', ''' | 747 CompletionTestCase.buildTests('testCompletion_annotation_argumentList', ''' |
| 719 class AAA {", | 748 class AAA {", |
| 720 const AAA({int aaa, int bbb});", | 749 const AAA({int aaa, int bbb});", |
| 721 }", | 750 }", |
| 722 ", | 751 ", |
| 723 @AAA(!1) | 752 @AAA(!1) |
| 724 main() { | 753 main() { |
| 725 }''', <String>["1+AAA" /*":" + ProposalKind.ARGUMENT_LIST*/, "1+aaa", "1+bbb"]); | 754 }''', |
| 755 <String>["1+AAA" /*":" + ProposalKind.ARGUMENT_LIST*/, "1+aaa", "1+bbb"] , | |
| 756 failingTests: '1'); | |
| 726 | 757 |
| 727 CompletionTestCase.buildTests('testCompletion_annotation_topLevelVar', ''' | 758 CompletionTestCase.buildTests('testCompletion_annotation_topLevelVar', ''' |
| 728 const fooConst = null; | 759 const fooConst = null; |
| 729 final fooNotConst = null; | 760 final fooNotConst = null; |
| 730 const bar = null; | 761 const bar = null; |
| 731 | 762 |
| 732 @foo!1 | 763 @foo!1 |
| 733 main() { | 764 main() { |
| 734 }''', <String>["1+fooConst", "1-fooNotConst", "1-bar"]); | 765 }''', <String>["1+fooConst", "1-fooNotConst", "1-bar"]); |
| 735 | 766 |
| 736 CompletionTestCase.buildTests('testCompletion_annotation_type', ''' | 767 CompletionTestCase.buildTests('testCompletion_annotation_type', ''' |
| 737 class AAA { | 768 class AAA { |
| 738 const AAA({int a, int b}); | 769 const AAA({int a, int b}); |
| 739 const AAA.nnn(int c, int d); | 770 const AAA.nnn(int c, int d); |
| 740 } | 771 } |
| 741 @AAA!1 | 772 @AAA!1 |
| 742 main() { | 773 main() { |
| 743 }''', | 774 }''', |
| 744 <String>[ | 775 <String>[ |
| 745 "1+AAA" /*":" + ProposalKind.CONSTRUCTOR*/, | 776 "1+AAA" /*":" + ProposalKind.CONSTRUCTOR*/, |
| 746 "1+AAA.nnn" /*":" + ProposalKind.CONSTRUCTOR*/]); | 777 "1+AAA.nnn" /*":" + ProposalKind.CONSTRUCTOR*/], |
| 778 failingTests: '1'); | |
| 747 | 779 |
| 748 CompletionTestCase.buildTests( | 780 CompletionTestCase.buildTests( |
| 749 'testCompletion_annotation_type_inClass_withoutMember', | 781 'testCompletion_annotation_type_inClass_withoutMember', |
| 750 ''' | 782 ''' |
| 751 class AAA { | 783 class AAA { |
| 752 const AAA(); | 784 const AAA(); |
| 753 } | 785 } |
| 754 | 786 |
| 755 class C { | 787 class C { |
| 756 @A!1 | 788 @A!1 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 802 aaa() {} | 834 aaa() {} |
| 803 } | 835 } |
| 804 | 836 |
| 805 | 837 |
| 806 main(A a) { | 838 main(A a) { |
| 807 a..!1 aaa(); | 839 a..!1 aaa(); |
| 808 }''', <String>["1+aaa", "1-main"]); | 840 }''', <String>["1+aaa", "1-main"]); |
| 809 | 841 |
| 810 CompletionTestCase.buildTests('testCompletion_combinator_afterComma', ''' | 842 CompletionTestCase.buildTests('testCompletion_combinator_afterComma', ''' |
| 811 "import 'dart:math' show cos, !1;''', | 843 "import 'dart:math' show cos, !1;''', |
| 812 <String>["1+PI", "1+sin", "1+Random", "1-String"]); | 844 <String>["1+PI", "1+sin", "1+Random", "1-String"], |
| 845 failingTests: '1'); | |
| 813 | 846 |
| 814 CompletionTestCase.buildTests('testCompletion_combinator_ended', ''' | 847 CompletionTestCase.buildTests('testCompletion_combinator_ended', ''' |
| 815 import 'dart:math' show !1;"''', | 848 import 'dart:math' show !1;"''', |
| 816 <String>["1+PI", "1+sin", "1+Random", "1-String"]); | 849 <String>["1+PI", "1+sin", "1+Random", "1-String"], |
| 850 failingTests: '1'); | |
| 817 | 851 |
| 818 CompletionTestCase.buildTests('testCompletion_combinator_export', ''' | 852 CompletionTestCase.buildTests('testCompletion_combinator_export', ''' |
| 819 export 'dart:math' show !1;"''', | 853 export 'dart:math' show !1;"''', |
| 820 <String>["1+PI", "1+sin", "1+Random", "1-String"]); | 854 <String>["1+PI", "1+sin", "1+Random", "1-String"], |
| 855 failingTests: '1'); | |
| 821 | 856 |
| 822 CompletionTestCase.buildTests('testCompletion_combinator_hide', ''' | 857 CompletionTestCase.buildTests('testCompletion_combinator_hide', ''' |
| 823 import 'dart:math' hide !1;"''', | 858 import 'dart:math' hide !1;"''', |
| 824 <String>["1+PI", "1+sin", "1+Random", "1-String"]); | 859 <String>["1+PI", "1+sin", "1+Random", "1-String"], |
| 860 failingTests: '1'); | |
| 825 | 861 |
| 826 CompletionTestCase.buildTests('testCompletion_combinator_notEnded', ''' | 862 CompletionTestCase.buildTests('testCompletion_combinator_notEnded', ''' |
| 827 import 'dart:math' show !1"''', | 863 import 'dart:math' show !1"''', |
| 828 <String>["1+PI", "1+sin", "1+Random", "1-String"]); | 864 <String>["1+PI", "1+sin", "1+Random", "1-String"], |
| 865 failingTests: '1'); | |
| 829 | 866 |
| 830 CompletionTestCase.buildTests('testCompletion_combinator_usePrefix', ''' | 867 CompletionTestCase.buildTests('testCompletion_combinator_usePrefix', ''' |
| 831 import 'dart:math' show s!1"''', | 868 import 'dart:math' show s!1"''', |
| 832 <String>["1+sin", "1+sqrt", "1-cos", "1-String"]); | 869 <String>["1+sin", "1+sqrt", "1-cos", "1-String"], |
| 870 failingTests: '1'); | |
| 833 | 871 |
| 834 CompletionTestCase.buildTests('testCompletion_constructor_field', ''' | 872 CompletionTestCase.buildTests('testCompletion_constructor_field', ''' |
| 835 class X { X(this.field); int f!1ield;}''', <String>["1+field"]); | 873 class X { X(this.field); int f!1ield;}''', <String>["1+field"]); |
| 836 | 874 |
| 837 CompletionTestCase.buildTests( | 875 CompletionTestCase.buildTests( |
| 838 'testCompletion_constructorArguments_showOnlyCurrent', | 876 'testCompletion_constructorArguments_showOnlyCurrent', |
| 839 ''' | 877 ''' |
| 840 class A { | 878 class A { |
| 841 A.first(int p); | 879 A.first(int p); |
| 842 A.second(double p); | 880 A.second(double p); |
| 843 } | 881 } |
| 844 main() { | 882 main() { |
| 845 new A.first(!1); | 883 new A.first(!1); |
| 846 }''', <String>["1+A.first", "1-A.second"]); | 884 }''', <String>["1+A.first", "1-A.second"], failingTests: '1'); |
| 847 | 885 |
| 848 CompletionTestCase.buildTests( | 886 CompletionTestCase.buildTests( |
| 849 'testCompletion_constructorArguments_whenPrefixedType', | 887 'testCompletion_constructorArguments_whenPrefixedType', |
| 850 ''' | 888 ''' |
| 851 import 'dart:math' as m; | 889 import 'dart:math' as m; |
| 852 main() { | 890 main() { |
| 853 new m.Random(!1); | 891 new m.Random(!1); |
| 854 }''', <String>["1+Random:ARGUMENT_LIST"]); | 892 }''', <String>["1+Random:ARGUMENT_LIST"], failingTests: '1'); |
| 855 | 893 |
| 856 CompletionTestCase.buildTests( | 894 CompletionTestCase.buildTests( |
| 857 'testCompletion_dartDoc_reference_forClass', | 895 'testCompletion_dartDoc_reference_forClass', |
| 858 ''' | 896 ''' |
| 859 /** | 897 /** |
| 860 * [int!1] | 898 * [int!1] |
| 861 * [method!2] | 899 * [method!2] |
| 862 */ | 900 */ |
| 863 class AAA { | 901 class AAA { |
| 864 methodA() {} | 902 methodA() {} |
| 865 }''', <String>["1+int", "1-method", "2+methodA", "2-int"]); | 903 }''', <String>["1+int", "1-method", "2+methodA", "2-int"], failingTests: '1'); |
| 866 | 904 |
| 867 CompletionTestCase.buildTests( | 905 CompletionTestCase.buildTests( |
| 868 'testCompletion_dartDoc_reference_forConstructor', | 906 'testCompletion_dartDoc_reference_forConstructor', |
| 869 ''' | 907 ''' |
| 870 class A { | 908 class A { |
| 871 /** | 909 /** |
| 872 * [aa!1] | 910 * [aa!1] |
| 873 * [int!2] | 911 * [int!2] |
| 874 * [method!3] | 912 * [method!3] |
| 875 */ | 913 */ |
| 876 A.named(aaa, bbb) {} | 914 A.named(aaa, bbb) {} |
| 877 methodA() {} | 915 methodA() {} |
| 878 }''', <String>["1+aaa", "1-bbb", "2+int", "2-double", "3+methodA"]); | 916 }''', |
| 917 <String>["1+aaa", "1-bbb", "2+int", "2-double", "3+methodA"], | |
| 918 failingTests: '12'); | |
| 879 | 919 |
| 880 CompletionTestCase.buildTests( | 920 CompletionTestCase.buildTests( |
| 881 'testCompletion_dartDoc_reference_forFunction', | 921 'testCompletion_dartDoc_reference_forFunction', |
| 882 ''' | 922 ''' |
| 883 /** | 923 /** |
| 884 * [aa!1] | 924 * [aa!1] |
| 885 * [int!2] | 925 * [int!2] |
| 886 * [function!3] | 926 * [function!3] |
| 887 */ | 927 */ |
| 888 functionA(aaa, bbb) {} | 928 functionA(aaa, bbb) {} |
| 889 functionB() {}''', | 929 functionB() {}''', |
| 890 <String>[ | 930 <String>[ |
| 891 "1+aaa", | 931 "1+aaa", |
| 892 "1-bbb", | 932 "1-bbb", |
| 893 "2+int", | 933 "2+int", |
| 894 "2-double", | 934 "2-double", |
| 895 "3+functionA", | 935 "3+functionA", |
| 896 "3+functionB", | 936 "3+functionB", |
| 897 "3-int"]); | 937 "3-int"], |
| 938 failingTests: '12'); | |
| 898 | 939 |
| 899 CompletionTestCase.buildTests( | 940 CompletionTestCase.buildTests( |
| 900 'testCompletion_dartDoc_reference_forFunctionTypeAlias', | 941 'testCompletion_dartDoc_reference_forFunctionTypeAlias', |
| 901 ''' | 942 ''' |
| 902 /** | 943 /** |
| 903 * [aa!1] | 944 * [aa!1] |
| 904 * [int!2] | 945 * [int!2] |
| 905 * [Function!3] | 946 * [Function!3] |
| 906 */ | 947 */ |
| 907 typedef FunctionA(aaa, bbb) {} | 948 typedef FunctionA(aaa, bbb) {} |
| 908 typedef FunctionB() {}''', | 949 typedef FunctionB() {}''', |
| 909 <String>[ | 950 <String>[ |
| 910 "1+aaa", | 951 "1+aaa", |
| 911 "1-bbb", | 952 "1-bbb", |
| 912 "2+int", | 953 "2+int", |
| 913 "2-double", | 954 "2-double", |
| 914 "3+FunctionA", | 955 "3+FunctionA", |
| 915 "3+FunctionB", | 956 "3+FunctionB", |
| 916 "3-int"]); | 957 "3-int"], |
| 958 failingTests: '12'); | |
| 917 | 959 |
| 918 CompletionTestCase.buildTests( | 960 CompletionTestCase.buildTests( |
| 919 'testCompletion_dartDoc_reference_forMethod', | 961 'testCompletion_dartDoc_reference_forMethod', |
| 920 ''' | 962 ''' |
| 921 class A { | 963 class A { |
| 922 /** | 964 /** |
| 923 * [aa!1] | 965 * [aa!1] |
| 924 * [int!2] | 966 * [int!2] |
| 925 * [method!3] | 967 * [method!3] |
| 926 */ | 968 */ |
| 927 methodA(aaa, bbb) {} | 969 methodA(aaa, bbb) {} |
| 928 methodB() {} | 970 methodB() {} |
| 929 }''', | 971 }''', |
| 930 <String>[ | 972 <String>[ |
| 931 "1+aaa", | 973 "1+aaa", |
| 932 "1-bbb", | 974 "1-bbb", |
| 933 "2+int", | 975 "2+int", |
| 934 "2-double", | 976 "2-double", |
| 935 "3+methodA", | 977 "3+methodA", |
| 936 "3+methodB", | 978 "3+methodB", |
| 937 "3-int"]); | 979 "3-int"], |
| 980 failingTests: '2'); | |
| 938 | 981 |
| 939 CompletionTestCase.buildTests( | 982 CompletionTestCase.buildTests( |
| 940 'testCompletion_dartDoc_reference_incomplete', | 983 'testCompletion_dartDoc_reference_incomplete', |
| 941 ''' | 984 ''' |
| 942 /** | 985 /** |
| 943 * [doubl!1 some text | 986 * [doubl!1 some text |
| 944 * other text | 987 * other text |
| 945 */ | 988 */ |
| 946 class A {} | 989 class A {} |
| 947 /** | 990 /** |
| 948 * [!2 some text | 991 * [!2 some text |
| 949 * other text | 992 * other text |
| 950 */ | 993 */ |
| 951 class B {} | 994 class B {} |
| 952 /** | 995 /** |
| 953 * [!3] some text | 996 * [!3] some text |
| 954 */ | 997 */ |
| 955 class C {}''', | 998 class C {}''', |
| 956 <String>["1+double", "1-int", "2+int", "2+String", "3+int", "3+String"]) ; | 999 <String>["1+double", "1-int", "2+int", "2+String", "3+int", "3+String"], |
| 1000 failingTests: '123'); | |
| 957 | 1001 |
| 958 CompletionTestCase.buildTests('testCompletion_double_inFractionPart', ''' | 1002 CompletionTestCase.buildTests('testCompletion_double_inFractionPart', ''' |
| 959 main() { | 1003 main() { |
| 960 1.0!1 | 1004 1.0!1 |
| 961 }''', <String>["1-abs", "1-main"]); | 1005 }''', <String>["1-abs", "1-main"]); |
| 962 | 1006 |
| 963 CompletionTestCase.buildTests('testCompletion_enum', ''' | 1007 CompletionTestCase.buildTests('testCompletion_enum', ''' |
| 964 enum MyEnum {A, B, C} | 1008 enum MyEnum {A, B, C} |
| 965 main() { | 1009 main() { |
| 966 MyEnum.!1; | 1010 MyEnum.!1; |
| 967 }''', <String>["1+values", "1+A", "1+B", "1+C"]); | 1011 }''', <String>["1+values", "1+A", "1+B", "1+C"], failingTests: '1'); |
| 968 | 1012 |
| 969 CompletionTestCase.buildTests( | 1013 CompletionTestCase.buildTests( |
| 970 'testCompletion_exactPrefix_hasHigherRelevance', | 1014 'testCompletion_exactPrefix_hasHigherRelevance', |
| 971 ''' | 1015 ''' |
| 972 var STR; | 1016 var STR; |
| 973 main(p) { | 1017 main(p) { |
| 974 var str; | 1018 var str; |
| 975 str!1; | 1019 str!1; |
| 976 STR!2; | 1020 STR!2; |
| 977 Str!3; | 1021 Str!3; |
| 978 }''', | 1022 }''', |
| 979 <String>[ | 1023 <String>[ |
| 980 "1+str" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 1)*/, | 1024 "1+str" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 1)*/, |
| 981 "1+STR" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 0)*/, | 1025 "1+STR" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 0)*/, |
| 982 "2+STR" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 1)*/, | 1026 "2+STR" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 1)*/, |
| 983 "2+str" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 0)*/, | 1027 "2+str" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 0)*/, |
| 984 "3+String" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 1)*/, | 1028 "3+String" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 1)*/, |
| 985 "3+STR" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 0)*/, | 1029 "3+STR" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 0)*/, |
| 986 "3+str" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 0)*/]); | 1030 "3+str" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 0)*/]); |
| 987 | 1031 |
| 988 CompletionTestCase.buildTests('testCompletion_export_dart', ''' | 1032 CompletionTestCase.buildTests('testCompletion_export_dart', ''' |
| 989 import 'dart:math | 1033 import 'dart:math |
| 990 import 'dart:_chrome | 1034 import 'dart:_chrome |
| 991 import 'dart:_collection.dev | 1035 import 'dart:_collection.dev |
| 992 export 'dart:!1''', | 1036 export 'dart:!1''', |
| 993 <String>[ | 1037 <String>[ |
| 994 "1+dart:core", | 1038 "1+dart:core", |
| 995 "1+dart:math", | 1039 "1+dart:math", |
| 996 "1-dart:_chrome", | 1040 "1-dart:_chrome", |
| 997 "1-dart:_collection.dev"]); | 1041 "1-dart:_collection.dev"], |
| 1042 failingTests: '1'); | |
| 998 | 1043 |
| 999 CompletionTestCase.buildTests( | 1044 CompletionTestCase.buildTests( |
| 1000 'testCompletion_export_noStringLiteral_noSemicolon', | 1045 'testCompletion_export_noStringLiteral_noSemicolon', |
| 1001 ''' | 1046 ''' |
| 1002 import !1 | 1047 import !1 |
| 1003 | 1048 |
| 1004 class A {}''', <String>["1+'dart:!';", "1+'package:!';"]); | 1049 class A {}''', <String>["1+'dart:!';", "1+'package:!';"], failingTests: '1'); |
| 1005 | 1050 |
| 1006 CompletionTestCase.buildTests('testCompletion_forStmt_vars', ''' | 1051 CompletionTestCase.buildTests('testCompletion_forStmt_vars', ''' |
| 1007 class int{}class Foo { mth() { for (in!1t i = 0; i!2 < 5; i!3++); }}''', | 1052 class int{}class Foo { mth() { for (in!1t i = 0; i!2 < 5; i!3++); }}''', |
| 1008 <String>["1+int", "2+i", "3+i"]); | 1053 <String>["1+int", "2+i", "3+i"], |
| 1054 failingTests: '1'); | |
| 1009 | 1055 |
| 1010 CompletionTestCase.buildTests('testCompletion_function', ''' | 1056 CompletionTestCase.buildTests('testCompletion_function', ''' |
| 1011 class String{}class Foo { int boo = 7; mth() { PNGS.sort((String a, Str!1) => a. compareTo(b)); }}''', | 1057 class String{}class Foo { int boo = 7; mth() { PNGS.sort((String a, Str!1) => a. compareTo(b)); }}''', |
| 1012 <String>["1+String"]); | 1058 <String>["1+String"]); |
| 1013 | 1059 |
| 1014 CompletionTestCase.buildTests('testCompletion_function_partial', ''' | 1060 CompletionTestCase.buildTests('testCompletion_function_partial', ''' |
| 1015 class String{}class Foo { int boo = 7; mth() { PNGS.sort((String a, Str!1)); }}' '', | 1061 class String{}class Foo { int boo = 7; mth() { PNGS.sort((String a, Str!1)); }}' '', |
| 1016 <String>["1+String"]); | 1062 <String>["1+String"], |
| 1063 failingTests: '1'); | |
| 1017 | 1064 |
| 1018 CompletionTestCase.buildTests( | 1065 CompletionTestCase.buildTests( |
| 1019 'testCompletion_functionTypeParameter_namedArgument', | 1066 'testCompletion_functionTypeParameter_namedArgument', |
| 1020 ''' | 1067 ''' |
| 1021 typedef FFF(a, b, {x1, x2, y}); | 1068 typedef FFF(a, b, {x1, x2, y}); |
| 1022 main(FFF fff) { | 1069 main(FFF fff) { |
| 1023 fff(1, 2, !1)!2; | 1070 fff(1, 2, !1)!2; |
| 1024 }''', <String>["1+x1", "2-x2"]); | 1071 }''', <String>["1+x1", "2-x2"], failingTests: '1'); |
| 1025 | 1072 |
| 1026 CompletionTestCase.buildTests('testCompletion_ifStmt_field1', ''' | 1073 CompletionTestCase.buildTests('testCompletion_ifStmt_field1', ''' |
| 1027 class Foo { int myField = 7; mth() { if (!1) {}}}''', <String>["1+myField"]); | 1074 class Foo { int myField = 7; mth() { if (!1) {}}}''', <String>["1+myField"]); |
| 1028 | 1075 |
| 1029 CompletionTestCase.buildTests('testCompletion_ifStmt_field1a', ''' | 1076 CompletionTestCase.buildTests('testCompletion_ifStmt_field1a', ''' |
| 1030 class Foo { int myField = 7; mth() { if (!1) }}''', <String>["1+myField"]); | 1077 class Foo { int myField = 7; mth() { if (!1) }}''', <String>["1+myField"]); |
| 1031 | 1078 |
| 1032 CompletionTestCase.buildTests('testCompletion_ifStmt_field2', ''' | 1079 CompletionTestCase.buildTests('testCompletion_ifStmt_field2', ''' |
| 1033 class Foo { int myField = 7; mth() { if (m!1) {}}}''', <String>["1+myField"]); | 1080 class Foo { int myField = 7; mth() { if (m!1) {}}}''', <String>["1+myField"]); |
| 1034 | 1081 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 1057 class B { a() => null; y() => null} | 1104 class B { a() => null; y() => null} |
| 1058 void main() { | 1105 void main() { |
| 1059 var x; | 1106 var x; |
| 1060 var c; | 1107 var c; |
| 1061 if(c) { | 1108 if(c) { |
| 1062 x = new A(); | 1109 x = new A(); |
| 1063 } else { | 1110 } else { |
| 1064 x = new B(); | 1111 x = new B(); |
| 1065 } | 1112 } |
| 1066 x.!1; | 1113 x.!1; |
| 1067 }''', <String>["1+a", "1+x", "1+y"]); | 1114 }''', <String>["1+a", "1+x", "1+y"], failingTests: '1'); |
| 1068 | 1115 |
| 1069 CompletionTestCase.buildTests('testCompletion_ifStmt_unionType_strict', ''' | 1116 CompletionTestCase.buildTests('testCompletion_ifStmt_unionType_strict', ''' |
| 1070 class A { a() => null; x() => null} | 1117 class A { a() => null; x() => null} |
| 1071 class B { a() => null; y() => null} | 1118 class B { a() => null; y() => null} |
| 1072 void main() { | 1119 void main() { |
| 1073 var x; | 1120 var x; |
| 1074 var c; | 1121 var c; |
| 1075 if(c) { | 1122 if(c) { |
| 1076 x = new A(); | 1123 x = new A(); |
| 1077 } else { | 1124 } else { |
| 1078 x = new B(); | 1125 x = new B(); |
| 1079 } | 1126 } |
| 1080 x.!1; | 1127 x.!1; |
| 1081 }''', <String>["1+a", "1-x", "1-y"]); | 1128 }''', <String>["1+a", "1-x", "1-y"], failingTests: '1'); |
| 1082 | 1129 |
| 1083 CompletionTestCase.buildTests('testCompletion_import', ''' | 1130 CompletionTestCase.buildTests('testCompletion_import', ''' |
| 1084 import '!1';''', <String>["1+dart:!", "1+package:!"]); | 1131 import '!1';''', <String>["1+dart:!", "1+package:!"], failingTests: '1'); |
| 1085 | 1132 |
| 1086 CompletionTestCase.buildTests('testCompletion_import_dart', ''' | 1133 CompletionTestCase.buildTests('testCompletion_import_dart', ''' |
| 1087 import 'dart:math | 1134 import 'dart:math |
| 1088 import 'dart:_chrome | 1135 import 'dart:_chrome |
| 1089 import 'dart:_collection.dev | 1136 import 'dart:_collection.dev |
| 1090 import 'dart:!1''', | 1137 import 'dart:!1''', |
| 1091 <String>[ | 1138 <String>[ |
| 1092 "1+dart:core", | 1139 "1+dart:core", |
| 1093 "1+dart:math", | 1140 "1+dart:math", |
| 1094 "1-dart:_chrome", | 1141 "1-dart:_chrome", |
| 1095 "1-dart:_collection.dev"]); | 1142 "1-dart:_collection.dev"], |
| 1143 failingTests: '1'); | |
| 1096 | 1144 |
| 1097 CompletionTestCase.buildTests( | 1145 CompletionTestCase.buildTests( |
| 1098 'testCompletion_import_hasStringLiteral_noSemicolon', | 1146 'testCompletion_import_hasStringLiteral_noSemicolon', |
| 1099 ''' | 1147 ''' |
| 1100 import '!1' | 1148 import '!1' |
| 1101 | 1149 |
| 1102 class A {}''', <String>["1+dart:!", "1+package:!"]); | 1150 class A {}''', <String>["1+dart:!", "1+package:!"], failingTests: '1'); |
| 1103 | 1151 |
| 1104 CompletionTestCase.buildTests('testCompletion_import_noSpace', ''' | 1152 CompletionTestCase.buildTests('testCompletion_import_noSpace', ''' |
| 1105 import!1''', <String>["1+ 'dart:!';", "1+ 'package:!';"]); | 1153 import!1''', <String>["1+ 'dart:!';", "1+ 'package:!';"], failingTests: '1'); |
| 1106 | 1154 |
| 1107 CompletionTestCase.buildTests('testCompletion_import_noStringLiteral', ''' | 1155 CompletionTestCase.buildTests('testCompletion_import_noStringLiteral', ''' |
| 1108 import !1;''', <String>["1+'dart:!'", "1+'package:!'"]); | 1156 import !1;''', <String>["1+'dart:!'", "1+'package:!'"], failingTests: '1'); |
| 1109 | 1157 |
| 1110 CompletionTestCase.buildTests( | 1158 CompletionTestCase.buildTests( |
| 1111 'testCompletion_import_noStringLiteral_noSemicolon', | 1159 'testCompletion_import_noStringLiteral_noSemicolon', |
| 1112 ''' | 1160 ''' |
| 1113 import !1 | 1161 import !1 |
| 1114 | 1162 |
| 1115 class A {}''', <String>["1+'dart:!';", "1+'package:!';"]); | 1163 class A {}''', <String>["1+'dart:!';", "1+'package:!';"], failingTests: '1'); |
| 1116 | 1164 |
| 1117 CompletionTestCase.buildTests('testCompletion_incompleteClassMember', ''' | 1165 CompletionTestCase.buildTests('testCompletion_incompleteClassMember', ''' |
| 1118 class A { | 1166 class A { |
| 1119 Str!1 | 1167 Str!1 |
| 1120 final f = null; | 1168 final f = null; |
| 1121 }''', <String>["1+String", "1-bool"]); | 1169 }''', <String>["1+String", "1-bool"]); |
| 1122 | 1170 |
| 1123 CompletionTestCase.buildTests( | 1171 CompletionTestCase.buildTests( |
| 1124 'testCompletion_incompleteClosure_parameterType', | 1172 'testCompletion_incompleteClosure_parameterType', |
| 1125 ''' | 1173 ''' |
| 1126 f1(cb(String s)) {} | 1174 f1(cb(String s)) {} |
| 1127 f2(String s) {} | 1175 f2(String s) {} |
| 1128 main() { | 1176 main() { |
| 1129 f1((Str!1)); | 1177 f1((Str!1)); |
| 1130 f2((Str!2)); | 1178 f2((Str!2)); |
| 1131 }''', <String>["1+String", "1-bool", "2+String", "2-bool"]); | 1179 }''', <String>["1+String", "1-bool", "2+String", "2-bool"]); |
| 1132 | 1180 |
| 1133 CompletionTestCase.buildTests('testCompletion_inPeriodPeriod', ''' | 1181 CompletionTestCase.buildTests('testCompletion_inPeriodPeriod', ''' |
| 1134 main(String str) { | 1182 main(String str) { |
| 1135 1 < str.!1.length; | 1183 1 < str.!1.length; |
| 1136 1 + str.!2.length; | 1184 1 + str.!2.length; |
| 1137 1 + 2 * str.!3.length; | 1185 1 + 2 * str.!3.length; |
| 1138 }''', <String>["1+codeUnits", "2+codeUnits", "3+codeUnits"]); | 1186 }''', |
| 1187 <String>["1+codeUnits", "2+codeUnits", "3+codeUnits"], | |
| 1188 failingTests: '123'); | |
| 1139 | 1189 |
| 1140 // no checks, but no exceptions | 1190 // no checks, but no exceptions |
| 1141 CompletionTestCase.buildTests( | 1191 CompletionTestCase.buildTests( |
| 1142 'testCompletion_instanceCreation_unresolved', | 1192 'testCompletion_instanceCreation_unresolved', |
| 1143 ''' | 1193 ''' |
| 1144 class A { | 1194 class A { |
| 1145 } | 1195 } |
| 1146 main() { | 1196 main() { |
| 1147 new NoSuchClass(!1); | 1197 new NoSuchClass(!1); |
| 1148 new A.noSuchConstructor(!2); | 1198 new A.noSuchConstructor(!2); |
| 1149 }''', <String>["1+int", "2+int"]); | 1199 }''', <String>["1+int", "2+int"]); |
| 1150 | 1200 |
| 1151 CompletionTestCase.buildTests('testCompletion_import_lib', ''' | 1201 CompletionTestCase.buildTests('testCompletion_import_lib', ''' |
| 1152 import '!1''', <String>["1+my_lib.dart"], <String, String>{ | 1202 import '!1''', <String>["1+my_lib.dart"], extraFiles: <String, String>{ |
| 1153 "/my_lib.dart": "" | 1203 "/my_lib.dart": "" |
| 1154 }); | 1204 }, failingTests: '1'); |
| 1155 | 1205 |
| 1156 CompletionTestCase.buildTests('testCompletion_is', ''' | 1206 CompletionTestCase.buildTests('testCompletion_is', ''' |
| 1157 class MyClass {} | 1207 class MyClass {} |
| 1158 main(p) { | 1208 main(p) { |
| 1159 var isVariable; | 1209 var isVariable; |
| 1160 if (p is MyCla!1) {} | 1210 if (p is MyCla!1) {} |
| 1161 var v1 = p is MyCla!2; | 1211 var v1 = p is MyCla!2; |
| 1162 var v2 = p is !3; | 1212 var v2 = p is !3; |
| 1163 var v2 = p is!4; | 1213 var v2 = p is!4; |
| 1164 }''', | 1214 }''', |
| 1165 <String>[ | 1215 <String>["1+MyClass", "2+MyClass", "3+MyClass", "3-v1", "4+is", "4-isVar iable"], |
| 1166 "1+MyClass", | 1216 failingTests: '4'); |
| 1167 "2+MyClass", | |
| 1168 "3+MyClass", | |
| 1169 "3-v1", | |
| 1170 "4+is", | |
| 1171 "4-isVariable"]); | |
| 1172 | 1217 |
| 1173 CompletionTestCase.buildTests('testCompletion_is_asIdentifierStart', ''' | 1218 CompletionTestCase.buildTests('testCompletion_is_asIdentifierStart', ''' |
| 1174 main(p) { | 1219 main(p) { |
| 1175 var isVisible; | 1220 var isVisible; |
| 1176 var v1 = is!1; | 1221 var v1 = is!1; |
| 1177 var v2 = is!2 | 1222 var v2 = is!2 |
| 1178 }''', <String>["1+isVisible", "2+isVisible"]); | 1223 }''', <String>["1+isVisible", "2+isVisible"]); |
| 1179 | 1224 |
| 1180 CompletionTestCase.buildTests( | 1225 CompletionTestCase.buildTests( |
| 1181 'testCompletion_is_asPrefixedIdentifierStart', | 1226 'testCompletion_is_asPrefixedIdentifierStart', |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 1194 main(p) { | 1239 main(p) { |
| 1195 var justSomeVar; | 1240 var justSomeVar; |
| 1196 var v = p is !1 | 1241 var v = p is !1 |
| 1197 }''', <String>["1+MyClass", "1-justSomeVar"]); | 1242 }''', <String>["1+MyClass", "1-justSomeVar"]); |
| 1198 | 1243 |
| 1199 CompletionTestCase.buildTests('testCompletion_is_incompleteStatement2', ''' | 1244 CompletionTestCase.buildTests('testCompletion_is_incompleteStatement2', ''' |
| 1200 class MyClass {} | 1245 class MyClass {} |
| 1201 main(p) { | 1246 main(p) { |
| 1202 var isVariable; | 1247 var isVariable; |
| 1203 var v = p is!1 | 1248 var v = p is!1 |
| 1204 }''', <String>["1+is", "1-isVariable"]); | 1249 }''', <String>["1+is", "1-isVariable"], failingTests: '1'); |
| 1205 | 1250 |
| 1206 CompletionTestCase.buildTests('testCompletion_keyword_in', ''' | 1251 CompletionTestCase.buildTests('testCompletion_keyword_in', ''' |
| 1207 class Foo { int input = 7; mth() { if (in!1) {}}}''', <String>["1+input"]); | 1252 class Foo { int input = 7; mth() { if (in!1) {}}}''', <String>["1+input"]); |
| 1208 | 1253 |
| 1209 CompletionTestCase.buildTests( | 1254 CompletionTestCase.buildTests( |
| 1210 'testCompletion_keyword_syntheticIdentifier', | 1255 'testCompletion_keyword_syntheticIdentifier', |
| 1211 ''' | 1256 ''' |
| 1212 main() { | 1257 main() { |
| 1213 var caseVar; | 1258 var caseVar; |
| 1214 var otherVar; | 1259 var otherVar; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1268 | 1313 |
| 1269 CompletionTestCase.buildTests( | 1314 CompletionTestCase.buildTests( |
| 1270 'testCompletion_namedArgument_alreadyUsed', | 1315 'testCompletion_namedArgument_alreadyUsed', |
| 1271 ''' | 1316 ''' |
| 1272 func({foo}) {} main() { func(foo: 0, fo!1); }''', <String>["1-foo"]); | 1317 func({foo}) {} main() { func(foo: 0, fo!1); }''', <String>["1-foo"]); |
| 1273 | 1318 |
| 1274 CompletionTestCase.buildTests( | 1319 CompletionTestCase.buildTests( |
| 1275 'testCompletion_namedArgument_constructor', | 1320 'testCompletion_namedArgument_constructor', |
| 1276 ''' | 1321 ''' |
| 1277 class A {A({foo, bar}) {}} main() { new A(fo!1); }''', | 1322 class A {A({foo, bar}) {}} main() { new A(fo!1); }''', |
| 1278 <String>["1+foo", "1-bar"]); | 1323 <String>["1+foo", "1-bar"], |
| 1324 failingTests: '1'); | |
| 1279 | 1325 |
| 1280 CompletionTestCase.buildTests('testCompletion_namedArgument_empty', ''' | 1326 CompletionTestCase.buildTests('testCompletion_namedArgument_empty', ''' |
| 1281 func({foo, bar}) {} main() { func(!1); }''', | 1327 func({foo, bar}) {} main() { func(!1); }''', |
| 1282 <String>[ | 1328 <String>[ |
| 1283 "1+foo" /*":" + ProposalKind.NAMED_ARGUMENT*/, | 1329 "1+foo" /*":" + ProposalKind.NAMED_ARGUMENT*/, |
| 1284 "1-foo" /*":" + ProposalKind.OPTIONAL_ARGUMENT*/]); | 1330 "1-foo" /*":" + ProposalKind.OPTIONAL_ARGUMENT*/], |
| 1331 failingTests: '1'); | |
| 1285 | 1332 |
| 1286 CompletionTestCase.buildTests('testCompletion_namedArgument_function', ''' | 1333 CompletionTestCase.buildTests('testCompletion_namedArgument_function', ''' |
| 1287 func({foo, bar}) {} main() { func(fo!1); }''', <String>["1+foo", "1-bar"]); | 1334 func({foo, bar}) {} main() { func(fo!1); }''', |
| 1335 <String>["1+foo", "1-bar"], | |
| 1336 failingTests: '1'); | |
| 1288 | 1337 |
| 1289 CompletionTestCase.buildTests('testCompletion_namedArgument_notNamed', ''' | 1338 CompletionTestCase.buildTests('testCompletion_namedArgument_notNamed', ''' |
| 1290 func([foo]) {} main() { func(fo!1); }''', <String>["1-foo"]); | 1339 func([foo]) {} main() { func(fo!1); }''', <String>["1-foo"]); |
| 1291 | 1340 |
| 1292 CompletionTestCase.buildTests( | 1341 CompletionTestCase.buildTests( |
| 1293 'testCompletion_namedArgument_unresolvedFunction', | 1342 'testCompletion_namedArgument_unresolvedFunction', |
| 1294 ''' | 1343 ''' |
| 1295 main() { func(fo!1); }''', <String>["1-foo"]); | 1344 main() { func(fo!1); }''', <String>["1-foo"]); |
| 1296 | 1345 |
| 1297 CompletionTestCase.buildTests('testCompletion_newMemberType1', ''' | 1346 CompletionTestCase.buildTests('testCompletion_newMemberType1', ''' |
| 1298 class Collection{}class List extends Collection{}class Foo { !1 }''', | 1347 class Collection{}class List extends Collection{}class Foo { !1 }''', |
| 1299 <String>["1+Collection", "1+List"]); | 1348 <String>["1+Collection", "1+List"], |
| 1349 failingTests: '1'); | |
| 1300 | 1350 |
| 1301 CompletionTestCase.buildTests('testCompletion_newMemberType2', ''' | 1351 CompletionTestCase.buildTests('testCompletion_newMemberType2', ''' |
| 1302 class Collection{}class List extends Collection{}class Foo {!1}''', | 1352 class Collection{}class List extends Collection{}class Foo {!1}''', |
| 1303 <String>["1+Collection", "1+List"]); | 1353 <String>["1+Collection", "1+List"], |
| 1354 failingTests: '1'); | |
| 1304 | 1355 |
| 1305 CompletionTestCase.buildTests('testCompletion_newMemberType3', ''' | 1356 CompletionTestCase.buildTests('testCompletion_newMemberType3', ''' |
| 1306 class Collection{}class List extends Collection{}class Foo {L!1}''', | 1357 class Collection{}class List extends Collection{}class Foo {L!1}''', |
| 1307 <String>["1-Collection", "1+List"]); | 1358 <String>["1-Collection", "1+List"], |
| 1359 failingTests: '1'); | |
| 1308 | 1360 |
| 1309 CompletionTestCase.buildTests('testCompletion_newMemberType4', ''' | 1361 CompletionTestCase.buildTests('testCompletion_newMemberType4', ''' |
| 1310 class Collection{}class List extends Collection{}class Foo {C!1}''', | 1362 class Collection{}class List extends Collection{}class Foo {C!1}''', |
| 1311 <String>["1+Collection", "1-List"]); | 1363 <String>["1+Collection", "1-List"]); |
| 1312 | 1364 |
| 1313 CompletionTestCase.buildTests( | 1365 CompletionTestCase.buildTests( |
| 1314 'testCompletion_positionalArgument_constructor', | 1366 'testCompletion_positionalArgument_constructor', |
| 1315 ''' | 1367 ''' |
| 1316 class A { | 1368 class A { |
| 1317 A([foo, bar]); | 1369 A([foo, bar]); |
| 1318 } | 1370 } |
| 1319 main() { | 1371 main() { |
| 1320 new A(!1); | 1372 new A(!1); |
| 1321 new A(0, !2); | 1373 new A(0, !2); |
| 1322 }''', | 1374 }''', |
| 1323 <String>[ | 1375 <String>[ |
| 1324 "1+foo" /*":" + ProposalKind.OPTIONAL_ARGUMENT*/, | 1376 "1+foo" /*":" + ProposalKind.OPTIONAL_ARGUMENT*/, |
| 1325 "1-bar", | 1377 "1-bar", |
| 1326 "2-foo", | 1378 "2-foo", |
| 1327 "2+bar" /*":" | 1379 "2+bar" /*":" |
| 1328 + ProposalKind.OPTIONAL_ARGUMENT*/]); | 1380 + ProposalKind.OPTIONAL_ARGUMENT*/], failingTests: '12'); |
| 1329 | 1381 |
| 1330 CompletionTestCase.buildTests( | 1382 CompletionTestCase.buildTests( |
| 1331 'testCompletion_positionalArgument_function', | 1383 'testCompletion_positionalArgument_function', |
| 1332 ''' | 1384 ''' |
| 1333 func([foo, bar]) {} | 1385 func([foo, bar]) {} |
| 1334 main() { | 1386 main() { |
| 1335 func(!1); | 1387 func(!1); |
| 1336 func(0, !2); | 1388 func(0, !2); |
| 1337 }''', | 1389 }''', |
| 1338 <String>[ | 1390 <String>[ |
| 1339 "1+foo" /*":" + ProposalKind.OPTIONAL_ARGUMENT*/, | 1391 "1+foo" /*":" + ProposalKind.OPTIONAL_ARGUMENT*/, |
| 1340 "1-bar", | 1392 "1-bar", |
| 1341 "2-foo", | 1393 "2-foo", |
| 1342 "2+bar" /*":" | 1394 "2+bar" /*":" |
| 1343 + ProposalKind.OPTIONAL_ARGUMENT*/]); | 1395 + ProposalKind.OPTIONAL_ARGUMENT*/], failingTests: '12'); |
| 1344 | 1396 |
| 1345 CompletionTestCase.buildTests('testCompletion_preferStaticType', ''' | 1397 CompletionTestCase.buildTests('testCompletion_preferStaticType', ''' |
| 1346 class A { | 1398 class A { |
| 1347 foo() {} | 1399 foo() {} |
| 1348 } | 1400 } |
| 1349 class B extends A { | 1401 class B extends A { |
| 1350 bar() {} | 1402 bar() {} |
| 1351 } | 1403 } |
| 1352 main() { | 1404 main() { |
| 1353 A v = new B(); | 1405 A v = new B(); |
| 1354 v.!1 | 1406 v.!1 |
| 1355 }''', | 1407 }''', |
| 1356 <String>[ | 1408 <String>[ |
| 1357 "1+foo", | 1409 "1+foo", |
| 1358 "1-bar,potential=false,declaringType=B", | 1410 "1-bar,potential=false,declaringType=B", |
| 1359 "1+bar,potential=true,declaringType=B"]); | 1411 "1+bar,potential=true,declaringType=B"], |
| 1412 failingTests: '1'); | |
| 1360 | 1413 |
| 1361 CompletionTestCase.buildTests( | 1414 CompletionTestCase.buildTests( |
| 1362 'testCompletion_privateElement_sameLibrary_constructor', | 1415 'testCompletion_privateElement_sameLibrary_constructor', |
| 1363 ''' | 1416 ''' |
| 1364 class A { | 1417 class A { |
| 1365 A._c(); | 1418 A._c(); |
| 1366 A.c(); | 1419 A.c(); |
| 1367 } | 1420 } |
| 1368 main() { | 1421 main() { |
| 1369 new A.!1 | 1422 new A.!1 |
| 1370 }''', <String>["1+_c", "1+c"]); | 1423 }''', <String>["1+_c", "1+c"], failingTests: '1'); |
| 1371 | 1424 |
| 1372 CompletionTestCase.buildTests( | 1425 CompletionTestCase.buildTests( |
| 1373 'testCompletion_privateElement_sameLibrary_member', | 1426 'testCompletion_privateElement_sameLibrary_member', |
| 1374 ''' | 1427 ''' |
| 1375 class A { | 1428 class A { |
| 1376 _m() {} | 1429 _m() {} |
| 1377 m() {} | 1430 m() {} |
| 1378 } | 1431 } |
| 1379 main(A a) { | 1432 main(A a) { |
| 1380 a.!1 | 1433 a.!1 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1427 CompletionTestCase.buildTests( | 1480 CompletionTestCase.buildTests( |
| 1428 'testCompletion_return_withIdentifierPrefix', | 1481 'testCompletion_return_withIdentifierPrefix', |
| 1429 ''' | 1482 ''' |
| 1430 f() { var vvv = 42; return v!1 }''', <String>["1+vvv"]); | 1483 f() { var vvv = 42; return v!1 }''', <String>["1+vvv"]); |
| 1431 | 1484 |
| 1432 CompletionTestCase.buildTests('testCompletion_return_withoutExpression', ''' | 1485 CompletionTestCase.buildTests('testCompletion_return_withoutExpression', ''' |
| 1433 f() { var vvv = 42; return !1 }''', <String>["1+vvv"]); | 1486 f() { var vvv = 42; return !1 }''', <String>["1+vvv"]); |
| 1434 | 1487 |
| 1435 CompletionTestCase.buildTests('testCompletion_staticField1', ''' | 1488 CompletionTestCase.buildTests('testCompletion_staticField1', ''' |
| 1436 class num{}class Sunflower {static final n!2um MAX_D = 300;nu!3m xc, yc;Sun!4flo wer() {x!Xc = y!Yc = MA!1 }}''', | 1489 class num{}class Sunflower {static final n!2um MAX_D = 300;nu!3m xc, yc;Sun!4flo wer() {x!Xc = y!Yc = MA!1 }}''', |
| 1437 <String>["1+MAX_D", "X+xc", "Y+yc", "2+num", "3+num", "4+Sunflower"]); | 1490 <String>["1+MAX_D", "X+xc", "Y+yc", "2+num", "3+num", "4+Sunflower"], |
| 1491 failingTests: '23'); | |
| 1438 | 1492 |
| 1439 CompletionTestCase.buildTests('testCompletion_super_superType', ''' | 1493 CompletionTestCase.buildTests('testCompletion_super_superType', ''' |
| 1440 class A { | 1494 class A { |
| 1441 var fa; | 1495 var fa; |
| 1442 ma() {} | 1496 ma() {} |
| 1443 } | 1497 } |
| 1444 class B extends A { | 1498 class B extends A { |
| 1445 var fb; | 1499 var fb; |
| 1446 mb() {} | 1500 mb() {} |
| 1447 main() { | 1501 main() { |
| 1448 super.!1 | 1502 super.!1 |
| 1449 } | 1503 } |
| 1450 }''', <String>["1+fa", "1-fb", "1+ma", "1-mb"]); | 1504 }''', <String>["1+fa", "1-fb", "1+ma", "1-mb"]); |
| 1451 | 1505 |
| 1452 CompletionTestCase.buildTests( | 1506 CompletionTestCase.buildTests( |
| 1453 'testCompletion_superConstructorInvocation_noNamePrefix', | 1507 'testCompletion_superConstructorInvocation_noNamePrefix', |
| 1454 ''' | 1508 ''' |
| 1455 class A { | 1509 class A { |
| 1456 A.fooA(); | 1510 A.fooA(); |
| 1457 A.fooB(); | 1511 A.fooB(); |
| 1458 A.bar(); | 1512 A.bar(); |
| 1459 } | 1513 } |
| 1460 class B extends A { | 1514 class B extends A { |
| 1461 B() : super.!1 | 1515 B() : super.!1 |
| 1462 }''', <String>["1+fooA", "1+fooB", "1+bar"]); | 1516 }''', <String>["1+fooA", "1+fooB", "1+bar"], failingTests: '1'); |
| 1463 | 1517 |
| 1464 CompletionTestCase.buildTests( | 1518 CompletionTestCase.buildTests( |
| 1465 'testCompletion_superConstructorInvocation_withNamePrefix', | 1519 'testCompletion_superConstructorInvocation_withNamePrefix', |
| 1466 ''' | 1520 ''' |
| 1467 class A { | 1521 class A { |
| 1468 A.fooA(); | 1522 A.fooA(); |
| 1469 A.fooB(); | 1523 A.fooB(); |
| 1470 A.bar(); | 1524 A.bar(); |
| 1471 } | 1525 } |
| 1472 class B extends A { | 1526 class B extends A { |
| 1473 B() : super.f!1 | 1527 B() : super.f!1 |
| 1474 }''', <String>["1+fooA", "1+fooB", "1-bar"]); | 1528 }''', <String>["1+fooA", "1+fooB", "1-bar"], failingTests: '1'); |
| 1475 | 1529 |
| 1476 CompletionTestCase.buildTests( | 1530 CompletionTestCase.buildTests( |
| 1477 'testCompletion_this_bad_inConstructorInitializer', | 1531 'testCompletion_this_bad_inConstructorInitializer', |
| 1478 ''' | 1532 ''' |
| 1479 class A { | 1533 class A { |
| 1480 var f; | 1534 var f; |
| 1481 A() : f = this.!1; | 1535 A() : f = this.!1; |
| 1482 }''', <String>["1-toString"]); | 1536 }''', <String>["1-toString"]); |
| 1483 | 1537 |
| 1484 CompletionTestCase.buildTests( | 1538 CompletionTestCase.buildTests( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1526 class B extends A { | 1580 class B extends A { |
| 1527 var fb; | 1581 var fb; |
| 1528 mb() {} | 1582 mb() {} |
| 1529 main() { | 1583 main() { |
| 1530 this.!1 | 1584 this.!1 |
| 1531 } | 1585 } |
| 1532 }''', <String>["1+fa", "1+fb", "1+ma", "1+mb"]); | 1586 }''', <String>["1+fa", "1+fb", "1+ma", "1+mb"]); |
| 1533 | 1587 |
| 1534 CompletionTestCase.buildTests('testCompletion_topLevelField_init2', ''' | 1588 CompletionTestCase.buildTests('testCompletion_topLevelField_init2', ''' |
| 1535 class DateTime{static var JUN;}final num M = Dat!1eTime.JUN;''', | 1589 class DateTime{static var JUN;}final num M = Dat!1eTime.JUN;''', |
| 1536 <String>["1+DateTime", "1-void"]); | 1590 <String>["1+DateTime", "1-void"], |
| 1591 failingTests: '1'); | |
| 1537 | 1592 |
| 1538 CompletionTestCase.buildTests('testCompletion_while', ''' | 1593 CompletionTestCase.buildTests('testCompletion_while', ''' |
| 1539 class Foo { int boo = 7; mth() { while (b!1) {} }}''', <String>["1+boo"]); | 1594 class Foo { int boo = 7; mth() { while (b!1) {} }}''', <String>["1+boo"]); |
| 1540 } | 1595 } |
| 1541 | 1596 |
| 1542 void buildLibraryTests() { | 1597 void buildLibraryTests() { |
| 1543 Map<String, String> sources = new HashMap<String, String>(); | 1598 Map<String, String> sources = new HashMap<String, String>(); |
| 1544 | 1599 |
| 1545 CompletionTestCase.buildTests('test_export_ignoreIfThisLibraryExports', ''' | 1600 CompletionTestCase.buildTests('test_export_ignoreIfThisLibraryExports', ''' |
| 1546 export 'dart:math'; | 1601 export 'dart:math'; |
| 1547 libFunction() {}; | 1602 libFunction() {}; |
| 1548 main() { | 1603 main() { |
| 1549 !1 | 1604 !1 |
| 1550 }''', <String>["1-cos", "1+libFunction"]); | 1605 }''', <String>["1-cos", "1+libFunction"]); |
| 1551 | 1606 |
| 1552 sources.clear(); | 1607 sources.clear(); |
| 1553 sources["/lib.dart"] = ''' | 1608 sources["/lib.dart"] = ''' |
| 1554 library lib; | 1609 library lib; |
| 1555 export 'dart:math' hide sin; | 1610 export 'dart:math' hide sin; |
| 1556 libFunction() {};'''; | 1611 libFunction() {};'''; |
| 1557 CompletionTestCase.buildTests( | 1612 CompletionTestCase.buildTests( |
| 1558 'test_export_showIfImportLibraryWithExport', | 1613 'test_export_showIfImportLibraryWithExport', |
| 1559 ''' | 1614 ''' |
| 1560 import 'lib.dart' as p; | 1615 import 'lib.dart' as p; |
| 1561 main() { | 1616 main() { |
| 1562 p.!1 | 1617 p.!1 |
| 1563 }''', <String>["1+cos", "1-sin", "1+libFunction"], sources); | 1618 }''', |
| 1619 <String>["1+cos", "1-sin", "1+libFunction"], | |
| 1620 extraFiles: sources, | |
| 1621 failingTests: '1'); | |
| 1564 | 1622 |
| 1565 CompletionTestCase.buildTests('test_importPrefix_hideCombinator', ''' | 1623 CompletionTestCase.buildTests('test_importPrefix_hideCombinator', ''' |
| 1566 import 'dart:math' as math hide PI; | 1624 import 'dart:math' as math hide PI; |
| 1567 main() { | 1625 main() { |
| 1568 math.!1 | 1626 math.!1 |
| 1569 }''', <String>["1-PI", "1+LN10"]); | 1627 }''', <String>["1-PI", "1+LN10"], failingTests: '1'); |
| 1570 | 1628 |
| 1571 CompletionTestCase.buildTests('test_importPrefix_showCombinator', ''' | 1629 CompletionTestCase.buildTests('test_importPrefix_showCombinator', ''' |
| 1572 import 'dart:math' as math show PI; | 1630 import 'dart:math' as math show PI; |
| 1573 main() { | 1631 main() { |
| 1574 math.!1 | 1632 math.!1 |
| 1575 }''', <String>["1+PI", "1-LN10"]); | 1633 }''', <String>["1+PI", "1-LN10"]); |
| 1576 | 1634 |
| 1577 sources.clear(); | 1635 sources.clear(); |
| 1578 sources["/lib.dart"] = ''' | 1636 sources["/lib.dart"] = ''' |
| 1579 library lib | 1637 library lib |
| 1580 class _A | 1638 class _A |
| 1581 foo() {} | 1639 foo() {} |
| 1582 | 1640 |
| 1583 class A extends _A { | 1641 class A extends _A { |
| 1584 }'''; | 1642 }'''; |
| 1585 CompletionTestCase.buildTests('test_memberOfPrivateClass_otherLibrary', ''' | 1643 CompletionTestCase.buildTests('test_memberOfPrivateClass_otherLibrary', ''' |
| 1586 import 'lib.dart'; | 1644 import 'lib.dart'; |
| 1587 main(A a) { | 1645 main(A a) { |
| 1588 a.!1 | 1646 a.!1 |
| 1589 }''', <String>["1+foo"], sources); | 1647 }''', <String>["1+foo"], extraFiles: sources, failingTests: '1'); |
| 1590 | 1648 |
| 1591 sources.clear(); | 1649 sources.clear(); |
| 1592 sources["/lib.dart"] = ''' | 1650 sources["/lib.dart"] = ''' |
| 1593 library lib; | 1651 library lib; |
| 1594 class A { | 1652 class A { |
| 1595 A.c(); | 1653 A.c(); |
| 1596 A._c(); | 1654 A._c(); |
| 1597 }'''; | 1655 }'''; |
| 1598 CompletionTestCase.buildTests( | 1656 CompletionTestCase.buildTests( |
| 1599 'test_noPrivateElement_otherLibrary_constructor', | 1657 'test_noPrivateElement_otherLibrary_constructor', |
| 1600 ''' | 1658 ''' |
| 1601 import 'lib.dart'; | 1659 import 'lib.dart'; |
| 1602 main() { | 1660 main() { |
| 1603 new A.!1 | 1661 new A.!1 |
| 1604 }''', <String>["1-_c", "1+c"]); | 1662 }''', <String>["1-_c", "1+c"], failingTests: '1'); |
| 1605 | 1663 |
| 1606 sources.clear(); | 1664 sources.clear(); |
| 1607 sources["/lib.dart"] = ''' | 1665 sources["/lib.dart"] = ''' |
| 1608 library lib; | 1666 library lib; |
| 1609 class A { | 1667 class A { |
| 1610 var f; | 1668 var f; |
| 1611 var _f; | 1669 var _f; |
| 1612 }'''; | 1670 }'''; |
| 1613 CompletionTestCase.buildTests( | 1671 CompletionTestCase.buildTests( |
| 1614 'test_noPrivateElement_otherLibrary_member', | 1672 'test_noPrivateElement_otherLibrary_member', |
| 1615 ''' | 1673 ''' |
| 1616 import 'lib.dart'; | 1674 import 'lib.dart'; |
| 1617 main(A a) { | 1675 main(A a) { |
| 1618 a.!1 | 1676 a.!1 |
| 1619 }''', <String>["1-_f", "1+f"], sources); | 1677 }''', |
| 1678 <String>["1-_f", "1+f"], | |
| 1679 extraFiles: sources, | |
| 1680 failingTests: '1'); | |
| 1620 | 1681 |
| 1621 sources.clear(); | 1682 sources.clear(); |
| 1622 sources["/firth.dart"] = ''' | 1683 sources["/firth.dart"] = ''' |
| 1623 library firth; | 1684 library firth; |
| 1624 class SerializationException { | 1685 class SerializationException { |
| 1625 const SerializationException(); | 1686 const SerializationException(); |
| 1626 }'''; | 1687 }'''; |
| 1627 CompletionTestCase.buildTests('test001', ''' | 1688 CompletionTestCase.buildTests('test001', ''' |
| 1628 import 'firth.dart'; | 1689 import 'firth.dart'; |
| 1629 main() { | 1690 main() { |
| 1630 throw new Seria!1lizationException();}''', | 1691 throw new Seria!1lizationException();}''', |
| 1631 <String>["1+SerializationException"], | 1692 <String>["1+SerializationException"], |
| 1632 sources); | 1693 extraFiles: sources, |
| 1694 failingTests: '1'); | |
| 1633 | 1695 |
| 1634 // Type propagation. | 1696 // Type propagation. |
| 1635 // TODO Include corelib analysis (this works in the editor) | 1697 // TODO Include corelib analysis (this works in the editor) |
| 1636 CompletionTestCase.buildTests( | 1698 CompletionTestCase.buildTests( |
| 1637 'test002', | 1699 'test002', |
| 1638 '''t2() {var q=[0],z=q.!1length;q.!2clear();}''', | 1700 '''t2() {var q=[0],z=q.!1length;q.!2clear();}''', |
| 1639 <String>["1+length", "1+isEmpty", "2+clear"]); | 1701 <String>["1+length", "1+isEmpty", "2+clear"], |
| 1702 failingTests: '12'); | |
| 1640 | 1703 |
| 1641 // TODO Include corelib analysis | 1704 // TODO Include corelib analysis |
| 1642 CompletionTestCase.buildTests( | 1705 CompletionTestCase.buildTests( |
| 1643 'test003', | 1706 'test003', |
| 1644 '''class X{var q; f() {q.!1a!2}}''', | 1707 '''class X{var q; f() {q.!1a!2}}''', |
| 1645 <String>["1+end", "2+abs", "2-end"]); | 1708 <String>["1+end", "2+abs", "2-end"], |
| 1709 failingTests: '12'); | |
| 1646 | 1710 |
| 1647 // TODO Include corelib analysis | 1711 // TODO Include corelib analysis |
| 1648 // Resolving dart:html takes between 2.5s and 30s; json, about 0.12s | 1712 // Resolving dart:html takes between 2.5s and 30s; json, about 0.12s |
| 1649 CompletionTestCase.buildTests('test004()', ''' | 1713 CompletionTestCase.buildTests('test004', ''' |
| 1650 library foo; | 1714 library foo; |
| 1651 import 'dart:convert' as json; | 1715 import 'dart:convert' as json; |
| 1652 class JsonParserX{} | 1716 class JsonParserX{} |
| 1653 f1() {var x=new json.!1} | 1717 f1() {var x=new json.!1} |
| 1654 f2() {var x=new json.JsonPa!2} | 1718 f2() {var x=new json.JsonPa!2} |
| 1655 f3() {var x=new json.JsonParser!3}''', | 1719 f3() {var x=new json.JsonParser!3}''', |
| 1656 <String>[ | 1720 <String>[ |
| 1657 "1+JsonParser", | 1721 "1+JsonParser", |
| 1658 "1-JsonParserX", | 1722 "1-JsonParserX", |
| 1659 "2+JsonParser", | 1723 "2+JsonParser", |
| 1660 "2-JsonParserX", | 1724 "2-JsonParserX", |
| 1661 "3+JsonParser", | 1725 "3+JsonParser", |
| 1662 "3-JsonParserX"]); | 1726 "3-JsonParserX"], |
| 1727 failingTests: '123'); | |
| 1663 | 1728 |
| 1664 // TODO Enable after type propagation is implemented. Not yet. | 1729 // TODO Enable after type propagation is implemented. Not yet. |
| 1665 // TODO Include corelib analysis | 1730 // TODO Include corelib analysis |
| 1666 CompletionTestCase.buildTests( | 1731 CompletionTestCase.buildTests( |
| 1667 'test005', | 1732 'test005', |
| 1668 '''var PHI;main(){PHI=5.3;PHI.abs().!1 Object x;}''', | 1733 '''var PHI;main(){PHI=5.3;PHI.abs().!1 Object x;}''', |
| 1669 <String>["1+abs"]); | 1734 <String>["1+abs"], |
| 1735 failingTests: '1'); | |
| 1670 | 1736 |
| 1671 // Exercise import and export handling. | 1737 // Exercise import and export handling. |
| 1672 // Libraries are defined in partial order of increasing dependency. | 1738 // Libraries are defined in partial order of increasing dependency. |
| 1673 sources.clear(); | 1739 sources.clear(); |
| 1674 sources["/exp2a.dart"] = ''' | 1740 sources["/exp2a.dart"] = ''' |
| 1675 library exp2a; | 1741 library exp2a; |
| 1676 e2a() {}'''; | 1742 e2a() {}'''; |
| 1677 sources["/exp1b.dart"] = ''' | 1743 sources["/exp1b.dart"] = ''' |
| 1678 library exp1b;", | 1744 library exp1b;", |
| 1679 e1b() {}'''; | 1745 e1b() {}'''; |
| 1680 sources["/exp1a.dart"] = ''' | 1746 sources["/exp1a.dart"] = ''' |
| 1681 library exp1a;", | 1747 library exp1a;", |
| 1682 export 'exp1b.dart';", | 1748 export 'exp1b.dart';", |
| 1683 e1a() {}'''; | 1749 e1a() {}'''; |
| 1684 sources["/imp1.dart"] = ''' | 1750 sources["/imp1.dart"] = ''' |
| 1685 library imp1; | 1751 library imp1; |
| 1686 export 'exp1a.dart'; | 1752 export 'exp1a.dart'; |
| 1687 i1() {}'''; | 1753 i1() {}'''; |
| 1688 sources["/imp2.dart"] = ''' | 1754 sources["/imp2.dart"] = ''' |
| 1689 library imp2; | 1755 library imp2; |
| 1690 export 'exp2a.dart'; | 1756 export 'exp2a.dart'; |
| 1691 i2() {}'''; | 1757 i2() {}'''; |
| 1692 CompletionTestCase.buildTests('test007', ''' | 1758 CompletionTestCase.buildTests('test006', ''' |
| 1693 import 'imp1.dart'; | 1759 import 'imp1.dart'; |
| 1694 import 'imp2.dart'; | 1760 import 'imp2.dart'; |
| 1695 main() {!1 | 1761 main() {!1 |
| 1696 i1(); | 1762 i1(); |
| 1697 i2(); | 1763 i2(); |
| 1698 e1a(); | 1764 e1a(); |
| 1699 e1b(); | 1765 e1b(); |
| 1700 e2a(); | 1766 e2a(); |
| 1701 }''', <String>["1+i1", "1+i2", "1+e1a", "1+e2a", "1+e1b"], sources); | 1767 }''', |
| 1768 <String>["1+i1", "1+i2", "1+e1a", "1+e2a", "1+e1b"], | |
| 1769 extraFiles: sources, | |
| 1770 failingTests: '1'); | |
| 1702 | 1771 |
| 1703 // Exercise import and export handling. | 1772 // Exercise import and export handling. |
| 1704 // Libraries are defined in partial order of increasing dependency. | 1773 // Libraries are defined in partial order of increasing dependency. |
| 1705 sources.clear(); | 1774 sources.clear(); |
| 1706 sources["/l1.dart"] = ''' | 1775 sources["/l1.dart"] = ''' |
| 1707 library l1; | 1776 library l1; |
| 1708 var _l1t; var l1t;'''; | 1777 var _l1t; var l1t;'''; |
| 1709 CompletionTestCase.buildTests('test007', ''' | 1778 CompletionTestCase.buildTests('test007', ''' |
| 1710 import 'l1.dart'; | 1779 import 'l1.dart'; |
| 1711 main() { | 1780 main() { |
| 1712 var x = l!1 | 1781 var x = l!1 |
| 1713 var y = _!2 | 1782 var y = _!2 |
| 1714 }''', <String>["1+l1t", "1-_l1t", "2-_l1t"], sources); | 1783 }''', |
| 1784 <String>["1+l1t", "1-_l1t", "2-_l1t"], | |
| 1785 extraFiles: sources, | |
| 1786 failingTests: '1'); | |
| 1715 | 1787 |
| 1716 // Check private library exclusion | 1788 // Check private library exclusion |
| 1717 sources.clear(); | 1789 sources.clear(); |
| 1718 sources["/public.dart"] = ''' | 1790 sources["/public.dart"] = ''' |
| 1719 library public; | 1791 library public; |
| 1720 class NonPrivate { | 1792 class NonPrivate { |
| 1721 void publicMethod() { | 1793 void publicMethod() { |
| 1722 } | 1794 } |
| 1723 }'''; | 1795 }'''; |
| 1724 sources["/private.dart"] = ''' | 1796 sources["/private.dart"] = ''' |
| 1725 library _private; | 1797 library _private; |
| 1726 import 'public.dart'; | 1798 import 'public.dart'; |
| 1727 class Private extends NonPrivate { | 1799 class Private extends NonPrivate { |
| 1728 void privateMethod() { | 1800 void privateMethod() { |
| 1729 } | 1801 } |
| 1730 }'''; | 1802 }'''; |
| 1731 CompletionTestCase.buildTests('test008', ''' | 1803 CompletionTestCase.buildTests('test008', ''' |
| 1732 import 'private.dart'; | 1804 import 'private.dart'; |
| 1733 import 'public.dart'; | 1805 import 'public.dart'; |
| 1734 class Test { | 1806 class Test { |
| 1735 void test() { | 1807 void test() { |
| 1736 NonPrivate x = new NonPrivate(); | 1808 NonPrivate x = new NonPrivate(); |
| 1737 x.!1 //publicMethod but not privateMethod should appear | 1809 x.!1 //publicMethod but not privateMethod should appear |
| 1738 } | 1810 } |
| 1739 }''', <String>["1-privateMethod", "1+publicMethod"], sources); | 1811 }''', |
| 1812 <String>["1-privateMethod", "1+publicMethod"], | |
| 1813 extraFiles: sources, | |
| 1814 failingTests: '1'); | |
| 1740 | 1815 |
| 1741 // Exercise library prefixes. | 1816 // Exercise library prefixes. |
| 1742 sources.clear(); | 1817 sources.clear(); |
| 1743 sources["/lib.dart"] = ''' | 1818 sources["/lib.dart"] = ''' |
| 1744 library lib; | 1819 library lib; |
| 1745 int X = 1; | 1820 int X = 1; |
| 1746 void m(){} | 1821 void m(){} |
| 1747 class Y {}'''; | 1822 class Y {}'''; |
| 1748 CompletionTestCase.buildTests('test009', ''' | 1823 CompletionTestCase.buildTests('test009', ''' |
| 1749 import 'lib.dart' as Q; | 1824 import 'lib.dart' as Q; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 1765 "1+Y", | 1840 "1+Y", |
| 1766 "2+X", | 1841 "2+X", |
| 1767 "2+m", | 1842 "2+m", |
| 1768 "2+Y", | 1843 "2+Y", |
| 1769 "3+X", | 1844 "3+X", |
| 1770 "3+m", | 1845 "3+m", |
| 1771 "3+Y", | 1846 "3+Y", |
| 1772 "4+Y", | 1847 "4+Y", |
| 1773 "4-m", | 1848 "4-m", |
| 1774 "4-X"], | 1849 "4-X"], |
| 1775 sources); | 1850 extraFiles: sources, |
| 1851 failingTests: '1234'); | |
| 1776 } | 1852 } |
| 1777 | 1853 |
| 1778 void buildNumberedTests() { | 1854 void buildNumberedTests() { |
| 1779 CompletionTestCase.buildTests('test001', ''' | 1855 CompletionTestCase.buildTests('test001', ''' |
| 1780 void r1(var v) { | 1856 void r1(var v) { |
| 1781 v.!1toString!2().!3hash!4Code | 1857 v.!1toString!2().!3hash!4Code |
| 1782 }''', | 1858 }''', |
| 1783 <String>[ | 1859 <String>[ |
| 1784 "1+toString", | 1860 "1+toString", |
| 1785 "1-==", | 1861 "1-==", |
| 1786 "2+toString", | 1862 "2+toString", |
| 1787 "3+hashCode", | 1863 "3+hashCode", |
| 1788 "3+toString", | 1864 "3+toString", |
| 1789 "4+hashCode", | 1865 "4+hashCode", |
| 1790 "4-toString"]); | 1866 "4-toString"], |
| 1867 failingTests: '1234'); | |
| 1791 | 1868 |
| 1792 CompletionTestCase.buildTests('test002', ''' | 1869 CompletionTestCase.buildTests('test002', ''' |
| 1793 void r2(var vim) { | 1870 void r2(var vim) { |
| 1794 v!1.toString() | 1871 v!1.toString() |
| 1795 }''', <String>["1+vim"]); | 1872 }''', <String>["1+vim"]); |
| 1796 | 1873 |
| 1797 CompletionTestCase.buildTests('test003', ''' | 1874 CompletionTestCase.buildTests('test003', ''' |
| 1798 class A { | 1875 class A { |
| 1799 int a() => 3; | 1876 int a() => 3; |
| 1800 int b() => this.!1a(); | 1877 int b() => this.!1a(); |
| 1801 }''', <String>["1+a"]); | 1878 }''', <String>["1+a"]); |
| 1802 | 1879 |
| 1803 CompletionTestCase.buildTests('test004', ''' | 1880 CompletionTestCase.buildTests('test004', ''' |
| 1804 class A { | 1881 class A { |
| 1805 int x; | 1882 int x; |
| 1806 A() : this.!1x = 1; | 1883 A() : this.!1x = 1; |
| 1807 A.b() : this(); | 1884 A.b() : this(); |
| 1808 A.c() : this.!2b(); | 1885 A.c() : this.!2b(); |
| 1809 g() => new A.!3c(); | 1886 g() => new A.!3c(); |
| 1810 }''', <String>["1+x", "2+b", "3+c"]); | 1887 }''', <String>["1+x", "2+b", "3+c"], failingTests: '23'); |
| 1811 | 1888 |
| 1812 CompletionTestCase.buildTests('test005', ''' | 1889 CompletionTestCase.buildTests('test005', ''' |
| 1813 class A {} | 1890 class A {} |
| 1814 void rr(var vim) { | 1891 void rr(var vim) { |
| 1815 var !1vq = v!2.toString(); | 1892 var !1vq = v!2.toString(); |
| 1816 var vf; | 1893 var vf; |
| 1817 v!3.toString(); | 1894 v!3.toString(); |
| 1818 }''', | 1895 }''', |
| 1819 <String>[ | 1896 <String>[ |
| 1820 "1-A", | 1897 "1-A", |
| 1821 "1-vim", | 1898 "1-vim", |
| 1822 "1+vq", | 1899 "1+vq", |
| 1823 "1-vf", | 1900 "1-vf", |
| 1824 "1-this", | 1901 "1-this", |
| 1825 "1-void", | 1902 "1-void", |
| 1826 "1-null", | 1903 "1-null", |
| 1827 "1-false", | 1904 "1-false", |
| 1828 "2-A", | 1905 "2-A", |
| 1829 "2+vim", | 1906 "2+vim", |
| 1830 "2-vf", | 1907 "2-vf", |
| 1831 "2-vq", | 1908 "2-vq", |
| 1832 "2-this", | 1909 "2-this", |
| 1833 "2-void", | 1910 "2-void", |
| 1834 "2-null", | 1911 "2-null", |
| 1835 "2-false", | 1912 "2-false", |
| 1836 "3+vf", | 1913 "3+vf", |
| 1837 "3+vq", | 1914 "3+vq", |
| 1838 "3+vim", | 1915 "3+vim", |
| 1839 "3-A"]); | 1916 "3-A"], |
| 1917 failingTests: '1'); | |
| 1840 | 1918 |
| 1841 CompletionTestCase.buildTests('test006', ''' | 1919 CompletionTestCase.buildTests('test006', ''' |
| 1842 void r2(var vim, {va: 2, b: 3}) { | 1920 void r2(var vim, {va: 2, b: 3}) { |
| 1843 v!1.toString() | 1921 v!1.toString() |
| 1844 }''', <String>["1+va", "1-b"]); | 1922 }''', <String>["1+va", "1-b"]); |
| 1845 | 1923 |
| 1846 CompletionTestCase.buildTests('test007', ''' | 1924 CompletionTestCase.buildTests('test007', ''' |
| 1847 void r2(var vim, [va: 2, b: 3]) { | 1925 void r2(var vim, [va: 2, b: 3]) { |
| 1848 v!1.toString() | 1926 v!1.toString() |
| 1849 }''', <String>["1+va", "1-b"]); | 1927 }''', <String>["1+va", "1-b"]); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 1870 "6-Ctype", | 1948 "6-Ctype", |
| 1871 "7+Aclass", | 1949 "7+Aclass", |
| 1872 "7-Bclass", | 1950 "7-Bclass", |
| 1873 "8+Ctype", | 1951 "8+Ctype", |
| 1874 "9+abstract", | 1952 "9+abstract", |
| 1875 "A+with", | 1953 "A+with", |
| 1876 "B+Eclass", | 1954 "B+Eclass", |
| 1877 "B-Dclass", | 1955 "B-Dclass", |
| 1878 "B-Ctype", | 1956 "B-Ctype", |
| 1879 "C+Bclass", | 1957 "C+Bclass", |
| 1880 "C-Eclass"]); | 1958 "C-Eclass"], |
| 1959 failingTests: '12359A'); | |
| 1881 | 1960 |
| 1882 // keywords | 1961 // keywords |
| 1883 CompletionTestCase.buildTests('test009', ''' | 1962 CompletionTestCase.buildTests('test009', ''' |
| 1884 class num{} | 1963 class num{} |
| 1885 typedef !1dy!2namic TestFn1(); | 1964 typedef !1dy!2namic TestFn1(); |
| 1886 typedef !3vo!4id TestFn2(); | 1965 typedef !3vo!4id TestFn2(); |
| 1887 typ!7edef !5n!6''', | 1966 typ!7edef !5n!6''', |
| 1888 <String>[ | 1967 <String>[ |
| 1889 "1+void", | 1968 "1+void", |
| 1890 "1+TestFn2", | 1969 "1+TestFn2", |
| 1891 "2+dynamic", | 1970 "2+dynamic", |
| 1892 "2-void", | 1971 "2-void", |
| 1893 "3+dynamic", | 1972 "3+dynamic", |
| 1894 "4+void", | 1973 "4+void", |
| 1895 "4-dynamic", | 1974 "4-dynamic", |
| 1896 "5+TestFn2", | 1975 "5+TestFn2", |
| 1897 "6+num", | 1976 "6+num", |
| 1898 "7+typedef"]); | 1977 "7+typedef"], |
| 1978 failingTests: '12347'); | |
| 1899 | 1979 |
| 1900 CompletionTestCase.buildTests('test010', ''' | 1980 CompletionTestCase.buildTests('test010', ''' |
| 1901 class String{}class List{} | 1981 class String{}class List{} |
| 1902 class test !8<!1t !2 !3extends String,!4 List,!5 !6>!7 {} | 1982 class test !8<!1t !2 !3extends String,!4 List,!5 !6>!7 {} |
| 1903 class tezetst !9<!BString,!C !DList>!A {}''', | 1983 class tezetst !9<!BString,!C !DList>!A {}''', |
| 1904 <String>[ | 1984 <String>[ |
| 1905 "1+String", | 1985 "1+String", |
| 1906 "1+List", | 1986 "1+List", |
| 1907 "1-test", | 1987 "1-test", |
| 1908 "2-String", | 1988 "2-String", |
| 1909 "2-test", | 1989 "2-test", |
| 1910 "3+extends", | 1990 "3+extends", |
| 1911 "4+tezetst", | 1991 "4+tezetst", |
| 1912 "4-test", | 1992 "4-test", |
| 1913 "5+String", | 1993 "5+String", |
| 1914 "6+List", | 1994 "6+List", |
| 1915 "7-List", | 1995 "7-List", |
| 1916 "8-List", | 1996 "8-List", |
| 1917 "9-String", | 1997 "9-String", |
| 1918 "A-String", | 1998 "A-String", |
| 1919 "B+String", | 1999 "B+String", |
| 1920 "C+List", | 2000 "C+List", |
| 1921 "C-tezetst", | 2001 "C-tezetst", |
| 1922 "D+List", | 2002 "D+List", |
| 1923 "D+test"]); | 2003 "D+test"], |
| 2004 failingTests: '3'); | |
| 1924 | 2005 |
| 1925 // name generation with conflicts | 2006 // name generation with conflicts |
| 1926 CompletionTestCase.buildTests( | 2007 CompletionTestCase.buildTests( |
| 1927 'test011', | 2008 'test011', |
| 1928 '''r2(var object, Object object1, Object !1);''', | 2009 '''r2(var object, Object object1, Object !1);''', |
| 1929 <String>["1+object2"]); | 2010 <String>["1+object2"], |
| 2011 failingTests: '1'); | |
| 1930 | 2012 |
| 1931 // reserved words | 2013 // reserved words |
| 1932 CompletionTestCase.buildTests('test012', ''' | 2014 CompletionTestCase.buildTests('test012', ''' |
| 1933 class X { | 2015 class X { |
| 1934 f() { | 2016 f() { |
| 1935 g(!1var!2 z) {!3true.!4toString();}; | 2017 g(!1var!2 z) {!3true.!4toString();}; |
| 1936 } | 2018 } |
| 1937 }''', | 2019 }''', |
| 1938 <String>[ | 2020 <String>[ |
| 1939 "1+var", | 2021 "1+var", |
| 1940 "1+dynamic", | 2022 "1+dynamic", |
| 1941 "1-f", | 2023 "1-f", |
| 1942 "2+var", | 2024 "2+var", |
| 1943 "2-dynamic", | 2025 "2-dynamic", |
| 1944 "3+false", | 2026 "3+false", |
| 1945 "3+true", | 2027 "3+true", |
| 1946 "4+toString"]); | 2028 "4+toString"], |
| 2029 failingTests: '1234'); | |
| 1947 | 2030 |
| 1948 // conditions & operators | 2031 // conditions & operators |
| 1949 CompletionTestCase.buildTests('test013', ''' | 2032 CompletionTestCase.buildTests('test013', ''' |
| 1950 class Q { | 2033 class Q { |
| 1951 bool x; | 2034 bool x; |
| 1952 List zs; | 2035 List zs; |
| 1953 int k; | 2036 int k; |
| 1954 var a; | 2037 var a; |
| 1955 mth() { | 2038 mth() { |
| 1956 while (!1x !9); | 2039 while (!1x !9); |
| 1957 do{} while(!2x !8); | 2040 do{} while(!2x !8); |
| 1958 for(z in !3zs) {} | 2041 for(z in !3zs) {} |
| 1959 switch(!4k) {case 1:{!0}} | 2042 switch(!4k) {case 1:{!0}} |
| 1960 try { | 2043 try { |
| 1961 } on !5Object catch(a){} | 2044 } on !5Object catch(a){} |
| 1962 if (!7x !6) {} else {}; | 2045 if (!7x !6) {} else {}; |
| 1963 } | 2046 } |
| 1964 }''', | 2047 }''', |
| 1965 <String>[ | 2048 <String>[ |
| 1966 "1+x", | 2049 "1+x", |
| 1967 "2+x", | 2050 "2+x", |
| 1968 "3+zs", | 2051 "3+zs", |
| 1969 "4+k", | 2052 "4+k", |
| 1970 "5+Q", | 2053 "5+Q", |
| 1971 "5-a", | 2054 "5-a", |
| 1972 "6+==", | 2055 "6+==", |
| 1973 "7+x", | 2056 "7+x", |
| 1974 "8+==", | 2057 "8+==", |
| 1975 "9+==", | 2058 "9+==", |
| 1976 "0+k"]); | 2059 "0+k"], |
| 2060 failingTests: '689'); | |
| 1977 | 2061 |
| 1978 // keywords | 2062 // keywords |
| 1979 CompletionTestCase.buildTests('test014', ''' | 2063 CompletionTestCase.buildTests('test014', ''' |
| 1980 class Q { | 2064 class Q { |
| 1981 bool x; | 2065 bool x; |
| 1982 List zs; | 2066 List zs; |
| 1983 int k; | 2067 int k; |
| 1984 !Dvar a; | 2068 !Dvar a; |
| 1985 !Evoid mth() { | 2069 !Evoid mth() { |
| 1986 !1while (z) { !Gcontinue; }; | 2070 !1while (z) { !Gcontinue; }; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 2008 "A+try", | 2092 "A+try", |
| 2009 "B+on", | 2093 "B+on", |
| 2010 "C+catch", | 2094 "C+catch", |
| 2011 "D+var", | 2095 "D+var", |
| 2012 "E+void", | 2096 "E+void", |
| 2013 "F+assert", | 2097 "F+assert", |
| 2014 "G+continue", | 2098 "G+continue", |
| 2015 "H+break", | 2099 "H+break", |
| 2016 "J+if", | 2100 "J+if", |
| 2017 "K+else", | 2101 "K+else", |
| 2018 "L+return"]); | 2102 "L+return"], |
| 2103 failingTests: '123456789ABCDEFGHJKL'); | |
| 2019 | 2104 |
| 2020 // operators in function | 2105 // operators in function |
| 2021 CompletionTestCase.buildTests( | 2106 CompletionTestCase.buildTests( |
| 2022 'test015', | 2107 'test015', |
| 2023 '''f(a,b,c) => a + b * c !1;''', | 2108 '''f(a,b,c) => a + b * c !1;''', |
| 2024 <String>["1+=="]); | 2109 <String>["1+=="], |
| 2110 failingTests: '1'); | |
| 2025 | 2111 |
| 2026 // operators in return | 2112 // operators in return |
| 2027 CompletionTestCase.buildTests( | 2113 CompletionTestCase.buildTests( |
| 2028 'test016', | 2114 'test016', |
| 2029 '''class X {dynamic f(a,b,c) {return a + b * c !1;}}''', | 2115 '''class X {dynamic f(a,b,c) {return a + b * c !1;}}''', |
| 2030 <String>["1+=="]); | 2116 <String>["1+=="], |
| 2117 failingTests: '1'); | |
| 2031 | 2118 |
| 2032 // keywords | 2119 // keywords |
| 2033 CompletionTestCase.buildTests('test017', ''' | 2120 CompletionTestCase.buildTests('test017', ''' |
| 2034 !1library foo; | 2121 !1library foo; |
| 2035 !2import 'x' !5as r; | 2122 !2import 'x' !5as r; |
| 2036 !3export '!8uri' !6hide Q !7show X; | 2123 !3export '!8uri' !6hide Q !7show X; |
| 2037 !4part 'x';''', | 2124 !4part 'x';''', |
| 2038 <String>[ | 2125 <String>[ |
| 2039 "1+library", | 2126 "1+library", |
| 2040 "2+import", | 2127 "2+import", |
| 2041 "3+export", | 2128 "3+export", |
| 2042 "4+part", | 2129 "4+part", |
| 2043 "5+as", | 2130 "5+as", |
| 2044 "6+hide", | 2131 "6+hide", |
| 2045 "7+show", | 2132 "7+show", |
| 2046 "8-null"]); | 2133 "8-null"], |
| 2134 failingTests: '1234567'); | |
| 2047 | 2135 |
| 2048 // keywords | 2136 // The following test is disabled because it prevents the Dart VM from |
| 2049 CompletionTestCase.buildTests( | 2137 // exiting, for some unknown reason. TODO(paulberry): fix this. |
|
Brian Wilkerson
2014/12/09 00:12:28
It didn't have a problem when I ran it locally (be
| |
| 2050 'test018', | 2138 // // keywords |
| 2051 '''!1part !2of foo;''', | 2139 // CompletionTestCase.buildTests( |
| 2052 <String>["1+part", "2+of"]); | 2140 // 'test018', |
| 2141 // '''!1part !2of foo;''', | |
| 2142 // <String>["1+part", "2+of"], | |
| 2143 // failingTests: '12'); | |
| 2053 | 2144 |
| 2054 CompletionTestCase.buildTests('test019', ''' | 2145 CompletionTestCase.buildTests('test019', ''' |
| 2055 var truefalse = 0; | 2146 var truefalse = 0; |
| 2056 var falsetrue = 1; | 2147 var falsetrue = 1; |
| 2057 main() { | 2148 main() { |
| 2058 var foo = true!1 | 2149 var foo = true!1 |
| 2059 }''', <String>["1+true", "1+truefalse", "1-falsetrue"]); | 2150 }''', <String>["1+true", "1+truefalse", "1-falsetrue"], failingTests: '1'); |
| 2060 | 2151 |
| 2061 CompletionTestCase.buildTests( | 2152 CompletionTestCase.buildTests( |
| 2062 'test020', | 2153 'test020', |
| 2063 '''var x = null.!1''', | 2154 '''var x = null.!1''', |
| 2064 <String>["1+toString"]); | 2155 <String>["1+toString"], |
| 2156 failingTests: '1'); | |
| 2065 | 2157 |
| 2066 CompletionTestCase.buildTests( | 2158 CompletionTestCase.buildTests( |
| 2067 'test021', | 2159 'test021', |
| 2068 '''var x = .!1''', | 2160 '''var x = .!1''', |
| 2069 <String>["1-toString"]); | 2161 <String>["1-toString"]); |
| 2070 | 2162 |
| 2071 CompletionTestCase.buildTests( | 2163 CompletionTestCase.buildTests( |
| 2072 'test022', | 2164 'test022', |
| 2073 '''var x = .!1;''', | 2165 '''var x = .!1;''', |
| 2074 <String>["1-toString"]); | 2166 <String>["1-toString"]); |
| 2075 | 2167 |
| 2076 CompletionTestCase.buildTests('test023', ''' | 2168 CompletionTestCase.buildTests('test023', ''' |
| 2077 class Map{getKeys(){}} | 2169 class Map{getKeys(){}} |
| 2078 class X { | 2170 class X { |
| 2079 static x1(Map m) { | 2171 static x1(Map m) { |
| 2080 m.!1getKeys; | 2172 m.!1getKeys; |
| 2081 } | 2173 } |
| 2082 x2(Map m) { | 2174 x2(Map m) { |
| 2083 m.!2getKeys; | 2175 m.!2getKeys; |
| 2084 } | 2176 } |
| 2085 }''', <String>["1+getKeys", "2+getKeys"]); | 2177 }''', <String>["1+getKeys", "2+getKeys"]); |
| 2086 | 2178 |
| 2087 // Note lack of semicolon following completion location | 2179 // Note lack of semicolon following completion location |
| 2088 CompletionTestCase.buildTests('test024', ''' | 2180 CompletionTestCase.buildTests('test024', ''' |
| 2089 class List{factory List.from(Iterable other) {}} | 2181 class List{factory List.from(Iterable other) {}} |
| 2090 class F { | 2182 class F { |
| 2091 f() { | 2183 f() { |
| 2092 new List.!1 | 2184 new List.!1 |
| 2093 } | 2185 } |
| 2094 }''', <String>["1+from"]); | 2186 }''', <String>["1+from"], failingTests: '1'); |
| 2095 | 2187 |
| 2096 CompletionTestCase.buildTests('test025', ''' | 2188 CompletionTestCase.buildTests('test025', ''' |
| 2097 class R { | 2189 class R { |
| 2098 static R _m; | 2190 static R _m; |
| 2099 static R m; | 2191 static R m; |
| 2100 f() { | 2192 f() { |
| 2101 var a = !1m; | 2193 var a = !1m; |
| 2102 var b = _!2m; | 2194 var b = _!2m; |
| 2103 var c = !3g(); | 2195 var c = !3g(); |
| 2104 } | 2196 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2194 "2+EIN", | 2286 "2+EIN", |
| 2195 "2-ICHI", | 2287 "2-ICHI", |
| 2196 "3+ICHI", | 2288 "3+ICHI", |
| 2197 "3+UKSI", | 2289 "3+UKSI", |
| 2198 "3+EIN", | 2290 "3+EIN", |
| 2199 "3+ONE"]); | 2291 "3+ONE"]); |
| 2200 | 2292 |
| 2201 CompletionTestCase.buildTests( | 2293 CompletionTestCase.buildTests( |
| 2202 'test033', | 2294 'test033', |
| 2203 '''class A{}class B extends A{b(){}}class C implements A {c(){}}class X{ x(){A f;f.!1}}''', | 2295 '''class A{}class B extends A{b(){}}class C implements A {c(){}}class X{ x(){A f;f.!1}}''', |
| 2204 <String>["1+b", "1-c"]); | 2296 <String>["1+b", "1-c"], |
| 2297 failingTests: '1'); | |
| 2205 | 2298 |
| 2206 // TODO(scheglov) decide what to do with Type for untyped field (not | 2299 // TODO(scheglov) decide what to do with Type for untyped field (not |
| 2207 // supported by the new store) | 2300 // supported by the new store) |
| 2208 // test analysis of untyped fields and top-level vars | 2301 // test analysis of untyped fields and top-level vars |
| 2209 CompletionTestCase.buildTests('test034', ''' | 2302 CompletionTestCase.buildTests('test034', ''' |
| 2210 var topvar; | 2303 var topvar; |
| 2211 class Top {top(){}} | 2304 class Top {top(){}} |
| 2212 class Left extends Top {left(){}} | 2305 class Left extends Top {left(){}} |
| 2213 class Right extends Top {right(){}} | 2306 class Right extends Top {right(){}} |
| 2214 t1() { | 2307 t1() { |
| 2215 topvar = new Left(); | 2308 topvar = new Left(); |
| 2216 } | 2309 } |
| 2217 t2() { | 2310 t2() { |
| 2218 topvar = new Right(); | 2311 topvar = new Right(); |
| 2219 } | 2312 } |
| 2220 class A { | 2313 class A { |
| 2221 var field; | 2314 var field; |
| 2222 a() { | 2315 a() { |
| 2223 field = new Left(); | 2316 field = new Left(); |
| 2224 } | 2317 } |
| 2225 b() { | 2318 b() { |
| 2226 field = new Right(); | 2319 field = new Right(); |
| 2227 } | 2320 } |
| 2228 test() { | 2321 test() { |
| 2229 topvar.!1top(); | 2322 topvar.!1top(); |
| 2230 field.!2top(); | 2323 field.!2top(); |
| 2231 } | 2324 } |
| 2232 }''', <String>["1+top", "2+top"]); | 2325 }''', <String>["1+top", "2+top"], failingTests: '12'); |
| 2233 | 2326 |
| 2234 // test analysis of untyped fields and top-level vars | 2327 // test analysis of untyped fields and top-level vars |
| 2235 CompletionTestCase.buildTests( | 2328 CompletionTestCase.buildTests( |
| 2236 'test035', | 2329 'test035', |
| 2237 '''class Y {final x='hi';mth() {x.!1length;}}''', | 2330 '''class Y {final x='hi';mth() {x.!1length;}}''', |
| 2238 <String>["1+length"]); | 2331 <String>["1+length"], |
| 2332 failingTests: '1'); | |
| 2239 | 2333 |
| 2240 // TODO(scheglov) decide what to do with Type for untyped field (not | 2334 // TODO(scheglov) decide what to do with Type for untyped field (not |
| 2241 // supported by the new store) | 2335 // supported by the new store) |
| 2242 // test analysis of untyped fields and top-level vars | 2336 // test analysis of untyped fields and top-level vars |
| 2243 CompletionTestCase.buildTests('test036', ''' | 2337 CompletionTestCase.buildTests('test036', ''' |
| 2244 class A1 { | 2338 class A1 { |
| 2245 var field; | 2339 var field; |
| 2246 A1() : field = 0; | 2340 A1() : field = 0; |
| 2247 q() { | 2341 q() { |
| 2248 A1 a = new A1(); | 2342 A1 a = new A1(); |
| 2249 a.field.!1 | 2343 a.field.!1 |
| 2250 } | 2344 } |
| 2251 } | 2345 } |
| 2252 main() { | 2346 main() { |
| 2253 A1 a = new A1(); | 2347 A1 a = new A1(); |
| 2254 a.field.!2 | 2348 a.field.!2 |
| 2255 }''', <String>["1+round", "2+round"]); | 2349 }''', <String>["1+round", "2+round"], failingTests: '12'); |
| 2256 | 2350 |
| 2257 CompletionTestCase.buildTests('test037', ''' | 2351 CompletionTestCase.buildTests('test037', ''' |
| 2258 class HttpServer{} | 2352 class HttpServer{} |
| 2259 class HttpClient{} | 2353 class HttpClient{} |
| 2260 main() { | 2354 main() { |
| 2261 new HtS!1 | 2355 new HtS!1 |
| 2262 }''', <String>["1+HttpServer", "1-HttpClient"]); | 2356 }''', <String>["1+HttpServer", "1-HttpClient"]); |
| 2263 | 2357 |
| 2264 CompletionTestCase.buildTests('test038', ''' | 2358 CompletionTestCase.buildTests('test038', ''' |
| 2265 class X { | 2359 class X { |
| 2266 x(){} | 2360 x(){} |
| 2267 } | 2361 } |
| 2268 class Y { | 2362 class Y { |
| 2269 y(){} | 2363 y(){} |
| 2270 } | 2364 } |
| 2271 class A<Z extends X> { | 2365 class A<Z extends X> { |
| 2272 Y ay; | 2366 Y ay; |
| 2273 Z az; | 2367 Z az; |
| 2274 A(this.ay, this.az) { | 2368 A(this.ay, this.az) { |
| 2275 ay.!1y; | 2369 ay.!1y; |
| 2276 az.!2x; | 2370 az.!2x; |
| 2277 } | 2371 } |
| 2278 }''', <String>["1+y", "1-x", "2+x", "2-y"]); | 2372 }''', <String>["1+y", "1-x", "2+x", "2-y"], failingTests: '2'); |
| 2279 | 2373 |
| 2280 // test analysis of untyped fields and top-level vars | 2374 // test analysis of untyped fields and top-level vars |
| 2281 CompletionTestCase.buildTests( | 2375 CompletionTestCase.buildTests( |
| 2282 'test039', | 2376 'test039', |
| 2283 '''class X{}var x = null as !1X;''', | 2377 '''class X{}var x = null as !1X;''', |
| 2284 <String>["1+X", "1-void"]); | 2378 <String>["1+X", "1-void"]); |
| 2285 | 2379 |
| 2286 // test arg lists with named params | 2380 // test arg lists with named params |
| 2287 CompletionTestCase.buildTests( | 2381 CompletionTestCase.buildTests( |
| 2288 'test040', | 2382 'test040', |
| 2289 '''m(){f(a, b, {x1, x2, y}) {};f(1, 2, !1)!2;}''', | 2383 '''m(){f(a, b, {x1, x2, y}) {};f(1, 2, !1)!2;}''', |
| 2290 <String>["1+x1", "2-x2"]); | 2384 <String>["1+x1", "2-x2"], |
| 2385 failingTests: '1'); | |
| 2291 | 2386 |
| 2292 // test arg lists with named params | 2387 // test arg lists with named params |
| 2293 CompletionTestCase.buildTests( | 2388 CompletionTestCase.buildTests( |
| 2294 'test041', | 2389 'test041', |
| 2295 '''m(){f(a, b, {x1, x2, y}) {};f(1, 2, !1''', | 2390 '''m(){f(a, b, {x1, x2, y}) {};f(1, 2, !1''', |
| 2296 <String>["1+x1", "1+x2", "1+y"]); | 2391 <String>["1+x1", "1+x2", "1+y"], |
| 2392 failingTests: '1'); | |
| 2297 | 2393 |
| 2298 // test arg lists with named params | 2394 // test arg lists with named params |
| 2299 CompletionTestCase.buildTests( | 2395 CompletionTestCase.buildTests( |
| 2300 'test042', | 2396 'test042', |
| 2301 '''m(){f(a, b, {x1, x2, y}) {};f(1, 2, !1;!2''', | 2397 '''m(){f(a, b, {x1, x2, y}) {};f(1, 2, !1;!2''', |
| 2302 <String>["1+x1", "1+x2", "2-y"]); | 2398 <String>["1+x1", "1+x2", "2-y"], |
| 2399 failingTests: '1'); | |
| 2303 } | 2400 } |
| 2304 | 2401 |
| 2305 void buildOtherTests() { | 2402 void buildOtherTests() { |
| 2306 CompletionTestCase.buildTests( | 2403 CompletionTestCase.buildTests( |
| 2307 'test_classMembers_inGetter', | 2404 'test_classMembers_inGetter', |
| 2308 '''class A { var fff; get z {ff!1}}''', | 2405 '''class A { var fff; get z {ff!1}}''', |
| 2309 <String>["1+fff"]); | 2406 <String>["1+fff"]); |
| 2310 | 2407 |
| 2311 CompletionTestCase.buildTests( | 2408 CompletionTestCase.buildTests( |
| 2312 'testSingle', | 2409 'testSingle', |
| 2313 '''class A {int x; !2mth() {int y = this.x;}}class B{}''', | 2410 '''class A {int x; !2mth() {int y = this.x;}}class B{}''', |
| 2314 <String>["2+B"]); | 2411 <String>["2+B"]); |
| 2315 } | 2412 } |
| 2316 } | 2413 } |
| OLD | NEW |