Add tests for binding pattern in parameter property declaration

This commit is contained in:
Yui T
2015-12-12 16:38:11 -08:00
parent f138953d88
commit 99722e442c
8 changed files with 74 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
/// <reference path='fourslash.ts'/>
// @Filename: file1.ts
//// class Foo {
//// constructor(private {/*0*/privateParam}: number,
//// public {/*1*/publicParam}: string,
//// protected {/*2*/protectedParam}: boolean) {
////
//// let localPrivate = /*3*/privateParam;
//// this.privateParam += 10; // this is not valid syntax
////
//// let localPublic = /*4*/publicParam;
//// this.publicParam += " Hello!"; // this is not valid syntax
////
//// let localProtected = /*5*/protectedParam;
//// this.protectedParam = false; // this is not valid syntax
//// }
//// }
let markers = test.markers()
for (let marker of markers) {
goTo.position(marker.position);
verify.documentHighlightsAtPositionCount(3, ["file1.ts"]);
}

View File

@@ -0,0 +1,24 @@
/// <reference path='fourslash.ts'/>
// @Filename: file1.ts
//// class Foo {
//// constructor(private [/*0*/privateParam]: number,
//// public [/*1*/publicParam]: string,
//// protected [/*2*/protectedParam]: boolean) {
////
//// let localPrivate = /*3*/privateParam;
//// this.privateParam += 10; // this is not valid syntax
////
//// let localPublic = /*4*/publicParam;
//// this.publicParam += " Hello!"; // this is not valid syntax
////
//// let localProtected = /*5*/protectedParam;
//// this.protectedParam = false; // this is not valid syntax
//// }
//// }
let markers = test.markers()
for (let marker of markers) {
goTo.position(marker.position);
verify.documentHighlightsAtPositionCount(2, ["file1.ts"]);
}

View File

@@ -0,0 +1,13 @@
/// <reference path='fourslash.ts'/>
//// class Foo {
//// constructor(protected { |protectedParam| }) {
//// let myProtectedParam = |protectedParam|;
//// }
//// }
let ranges = test.ranges()
for (let range of ranges) {
goTo.position(range.start);
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
}

View File

@@ -0,0 +1,13 @@
/// <reference path='fourslash.ts'/>
//// class Foo {
//// constructor(protected [ |protectedParam| ]) {
//// let myProtectedParam = |protectedParam|;
//// }
//// }
let ranges = test.ranges()
for (let range of ranges) {
goTo.position(range.start);
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
}