Add test + reshuffle/rename new code

This commit is contained in:
Nathan Shively-Sanders
2019-09-06 15:15:19 -07:00
parent 1703ae0f46
commit 330e51f098
6 changed files with 77 additions and 40 deletions
@@ -0,0 +1,9 @@
/// <reference path='fourslash.ts' />
// @noImplicitAny: true
//// function foo([|a, m |]) {
//// return a + m
//// }
verify.rangeAfterCodeFix("a: any, m: any", /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, /*index*/0);
@@ -0,0 +1,14 @@
/// <reference path='fourslash.ts' />
// @noImplicitAny: true
//// function foo([|p, a, b, c, d, e |]) {
//// var x: string = a.pop()
//// b.reverse()
//// var rr: boolean[] = c.reverse()
//// d.some(t => t > 1); // can't infer from callbacks right now
//// var y = e.concat(12); // can't infer from overloaded functions right now
//// return p.push(12)
//// }
verify.rangeAfterCodeFix("p: number[], a: string[], b: any[], c: boolean[], d: any[], e: number[]", /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, /*index*/0);
@@ -0,0 +1,10 @@
/// <reference path='fourslash.ts' />
// @noImplicitAny: true
//// function foo([|a, m |]) {
//// a = 'hi'
//// m = 1
//// }
verify.rangeAfterCodeFix("a: string, m: number", /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, /*index*/0);
@@ -0,0 +1,9 @@
/// <reference path='fourslash.ts' />
// @noImplicitAny: true
//// function foo([|p |]) {
//// return p.then((x: string[]) => x[0])
//// }
verify.rangeAfterCodeFix("p: Promise<string[]>", /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, /*index*/0);
@@ -0,0 +1,12 @@
/// <reference path='fourslash.ts' />
// @noImplicitAny: true
//// function foo([|p, a, b, c, d |]) {
//// var x
//// p.charAt(x)
//// a.charAt(0)
//// b.concat('hi')
//// }
verify.rangeAfterCodeFix("p: string, a: string, b: string | string[]", /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, /*index*/0);