More tests

This commit is contained in:
Sheetal Nandi 2019-05-31 10:23:07 -07:00
parent bbfbf8fa95
commit 2fc1143fe7
4 changed files with 14 additions and 10 deletions

View File

@ -1,11 +1,13 @@
/// <reference path='fourslash.ts'/>
////interface Gen {
//// x: number;
//// [|parent|]: Gen;
//// [|[|{| "declarationRangeIndex": 0 |}parent|]: Gen;|]
//// millenial: string;
////}
////let t: Gen;
////var { x, ...rest } = t;
////rest.[|parent|];
verify.rangesAreRenameLocations();
const rangesByText = test.rangesByText();
verify.rangesAreRenameLocations(rangesByText.get("parent"));

View File

@ -1,15 +1,16 @@
/// <reference path='fourslash.ts' />
////var o = {
//// [|prop|]: 0
//// [|[|{| "declarationRangeIndex": 0 |}prop|]: 0|]
////};
////
////o = {
//// "[|prop|]": 1
//// [|"[|{| "declarationRangeIndex": 2 |}prop|]": 1|]
////};
////
////o["[|prop|]"];
////o['[|prop|]'];
////o.[|prop|];
verify.rangesAreRenameLocations();
const rangesByText = test.rangesByText();
verify.rangesAreRenameLocations(rangesByText.get("prop"));

View File

@ -1,12 +1,12 @@
/// <reference path='fourslash.ts'/>
////function f([|this|]) {
////function f([|{| "declarationRangeIndex": 0 |}this|]) {
//// return [|this|];
////}
////this/**/;
////const _ = { [|this|]: 0 }.[|this|];
////const _ = { [|[|{| "declarationRangeIndex": 2 |}this|]: 0|] }.[|this|];
const [r0, r1, r2, r3] = test.ranges()
const [r0, r1, r2Def, r2, r3] = test.ranges()
verify.rangesAreRenameLocations([r0, r1]);
// Trying to rename a non-parameter 'this' should fail

View File

@ -4,10 +4,11 @@
//// export function doThing(): string;
//// export function doTheOtherThing(): void;
//// export as namespace [|myLib|];
//// [|export as namespace [|{| "declarationRangeIndex": 0 |}myLib|];|]
// @Filename: 1.ts
//// /// <reference path="0.d.ts" />
//// [|myLib|].doThing();
verify.rangesAreRenameLocations();
const rangesByText = test.rangesByText();
verify.rangesAreRenameLocations(rangesByText.get("myLib"));