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:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 class L{var k;void.!1}''', <String>["1-k"]); | 232 class L{var k;void.!1}''', <String>["1-k"]); |
| 233 | 233 |
| 234 buildTests('testCommentSnippets044', ''' | 234 buildTests('testCommentSnippets044', ''' |
| 235 class List{}class XXX {XXX.fisk();}main() {main(); new !1}}''', | 235 class List{}class XXX {XXX.fisk();}main() {main(); new !1}}''', |
| 236 <String>["1+List", "1+XXX.fisk"], failingTests: '1'); | 236 <String>["1+List", "1+XXX.fisk"], failingTests: '1'); |
| 237 | 237 |
| 238 buildTests('testCommentSnippets047', ''' | 238 buildTests('testCommentSnippets047', ''' |
| 239 f(){int x;int y=!1;}''', <String>["1+x"]); | 239 f(){int x;int y=!1;}''', <String>["1+x"]); |
| 240 | 240 |
| 241 buildTests('testCommentSnippets048', ''' | 241 buildTests('testCommentSnippets048', ''' |
| 242 import 'dart:convert' as json;f() {var x=new js!1}''', <String>["1+json"]); | 242 import 'dart:convert' as json;f() {var x=new js!1}''', <String>["1+json"], faili ngTests: '1'); |
| 243 | 243 |
| 244 buildTests('testCommentSnippets049', ''' | 244 buildTests('testCommentSnippets049', ''' |
| 245 import 'dart:convert' as json; | 245 import 'dart:convert' as json; |
| 246 import 'dart:convert' as jxx; | 246 import 'dart:convert' as jxx; |
| 247 class JsonDecoderX{} | 247 class JsonDecoderX{} |
| 248 f1() {var x=new !2j!1s!3}''', <String>[ | 248 f1() {var x=new !2j!1s!3}''', <String>[ |
| 249 "1+json", | 249 "1+json", |
| 250 "1+jxx", | 250 "1+jxx", |
| 251 "2+json", | 251 "2+json", |
| 252 "2+jxx", | 252 "2+jxx", |
| 253 "2-JsonDecoder", | 253 "2-JsonDecoder", |
| 254 "3+json", | 254 "3+json", |
| 255 "3-jxx" | 255 "3-jxx" |
| 256 ]); | 256 ], failingTests: '123'); |
|
danrubel
2015/03/03 15:58:07
Just realized that this CL breaks new <prefix>.
Wi
danrubel
2015/03/03 16:40:00
https://codereview.chromium.org/972193002/
| |
| 257 | 257 |
| 258 buildTests('testCommentSnippets050', ''' | 258 buildTests('testCommentSnippets050', ''' |
| 259 class xdr { | 259 class xdr { |
| 260 xdr(); | 260 xdr(); |
| 261 const xdr.a(a,b,c); | 261 const xdr.a(a,b,c); |
| 262 xdr.b(); | 262 xdr.b(); |
| 263 f() => 3; | 263 f() => 3; |
| 264 } | 264 } |
| 265 class xa{} | 265 class xa{} |
| 266 k() { | 266 k() { |
| 267 new x!1dr().f(); | 267 new x!1dr().f(); |
| 268 const x!2dr.!3a(1, 2, 3); | 268 const x!2dr.!3a(1, 2, 3); |
| 269 }''', <String>[ | 269 }''', <String>[ |
| 270 "1+xdr", | 270 "1+xdr", |
| 271 "1+xa", | 271 "1+xa", |
| 272 "1+xdr.a", | 272 "1+xdr.a", |
| 273 "1+xdr.b", | 273 "1+xdr.b", |
| 274 "2-xa", | 274 "2-xa", |
| 275 "2-xdr", | 275 "2-xdr", |
| 276 "2+xdr.a", | 276 "2+xdr.a", |
| 277 "2-xdr.b", | 277 "2-xdr.b", |
| 278 "3-b", | 278 "3-b", |
| 279 "3+a" | 279 "3+a" |
| 280 ], failingTests: '123'); | 280 ], failingTests: '23'); |
| 281 | 281 |
| 282 // Type propagation. | 282 // Type propagation. |
| 283 buildTests('testCommentSnippets051', ''' | 283 buildTests('testCommentSnippets051', ''' |
| 284 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} | 284 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{ge tKeys(){}} |
| 285 void r() { | 285 void r() { |
| 286 var v; | 286 var v; |
| 287 if (v is String) { | 287 if (v is String) { |
| 288 v.!1length; | 288 v.!1length; |
| 289 v.!2getKeys; | 289 v.!2getKeys; |
| 290 } | 290 } |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 618 class File { | 618 class File { |
| 619 factory File(String path) => null; | 619 factory File(String path) => null; |
| 620 factory File.fromPath(Path path) => null; | 620 factory File.fromPath(Path path) => null; |
| 621 } | 621 } |
| 622 f() => new Fil!1''', <String>[ | 622 f() => new Fil!1''', <String>[ |
| 623 "1+File", | 623 "1+File", |
| 624 "1+File.fromPath", | 624 "1+File.fromPath", |
| 625 "1+FileMode", | 625 "1+FileMode", |
| 626 "1+FileMode._internal1", | 626 "1+FileMode._internal1", |
| 627 "1+FileMode._internal" | 627 "1+FileMode._internal" |
| 628 ], failingTests: '1'); | 628 ]); |
| 629 | 629 |
| 630 buildTests('testCommentSnippets078', ''' | 630 buildTests('testCommentSnippets078', ''' |
| 631 class Map{static from()=>null;clear(){}}void main() { Map.!1 }''', | 631 class Map{static from()=>null;clear(){}}void main() { Map.!1 }''', |
| 632 <String>["1+from", "1-clear"]); // static method, instance method | 632 <String>["1+from", "1-clear"]); // static method, instance method |
| 633 | 633 |
| 634 buildTests('testCommentSnippets079', ''' | 634 buildTests('testCommentSnippets079', ''' |
| 635 class Map{static from()=>null;clear(){}}void main() { Map s; s.!1 }''', | 635 class Map{static from()=>null;clear(){}}void main() { Map s; s.!1 }''', |
| 636 <String>["1-from", "1+clear"]); // static method, instance method | 636 <String>["1-from", "1+clear"]); // static method, instance method |
| 637 | 637 |
| 638 buildTests('testCommentSnippets080', ''' | 638 buildTests('testCommentSnippets080', ''' |
| (...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2297 } else { | 2297 } else { |
| 2298 ++expectedPassCount; | 2298 ++expectedPassCount; |
| 2299 tester(testName, () { | 2299 tester(testName, () { |
| 2300 CompletionTestCase test = new CompletionTestCase(); | 2300 CompletionTestCase test = new CompletionTestCase(); |
| 2301 return test.runTest(spec, extraFiles); | 2301 return test.runTest(spec, extraFiles); |
| 2302 }); | 2302 }); |
| 2303 } | 2303 } |
| 2304 } | 2304 } |
| 2305 } | 2305 } |
| 2306 } | 2306 } |
| OLD | NEW |