Added more test cases for object binding patterns.
This commit is contained in:
parent
80fc545e59
commit
c0faaeecbe
4 changed files with 80 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
|||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////interface I {
|
||||
//// [|property1|]: number;
|
||||
//// property2: string;
|
||||
////}
|
||||
////
|
||||
////function f({ [|property1|]: p1 }: I,
|
||||
//// { [|property1|] }: I,
|
||||
//// { property1: p2 }) {
|
||||
////}
|
||||
|
||||
let ranges = test.ranges();
|
||||
for (let range of ranges) {
|
||||
goTo.position(range.start);
|
||||
|
||||
verify.referencesCountIs(ranges.length);
|
||||
for (let expectedRange of ranges) {
|
||||
verify.referencesAtPositionContains(expectedRange);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////interface I {
|
||||
//// property1: number;
|
||||
//// property2: string;
|
||||
////}
|
||||
////
|
||||
////function f({ [|property1|]: p }, { property1 }) {
|
||||
//// let x = property1;
|
||||
////}
|
||||
|
||||
// Notice only one range.
|
||||
let ranges = test.ranges();
|
||||
for (let range of ranges) {
|
||||
goTo.position(range.start);
|
||||
|
||||
verify.referencesCountIs(ranges.length);
|
||||
for (let expectedRange of ranges) {
|
||||
verify.referencesAtPositionContains(expectedRange);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////interface I {
|
||||
//// [|property1|]: number;
|
||||
//// property2: string;
|
||||
////}
|
||||
////
|
||||
////for (let { [|property1|]: p } of <I[]>[]) {
|
||||
////}
|
||||
////for (let { [|property1|] } of <I[]>[]) {
|
||||
////}
|
||||
////for (var { [|property1|]: p } of <I[]>[]) {
|
||||
////}
|
||||
|
||||
let ranges = test.ranges();
|
||||
for (let range of ranges) {
|
||||
goTo.position(range.start);
|
||||
|
||||
verify.referencesCountIs(ranges.length);
|
||||
for (let expectedRange of ranges) {
|
||||
verify.referencesAtPositionContains(expectedRange);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////let p, b;
|
||||
////
|
||||
////p, [{ [|a|]: p, b }] = [{ [|a|]: 10, b: true }];
|
||||
|
||||
let ranges = test.ranges();
|
||||
for (let range of ranges) {
|
||||
goTo.position(range.start);
|
||||
|
||||
verify.referencesCountIs(ranges.length);
|
||||
for (let expectedRange of ranges) {
|
||||
verify.referencesAtPositionContains(expectedRange);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue