From b00fa42dea98cdf3c9fd00923b6cd2a5ba288131 Mon Sep 17 00:00:00 2001 From: Yui T Date: Sat, 12 Dec 2015 15:52:55 -0800 Subject: [PATCH] Update tests --- ...HighlightAtParameterPropertyDeclaration.ts | 24 +++++++++++++++++++ ...indAllRefsParameterPropertyDeclaration1.ts | 18 ++++++++++++++ ...indAllRefsParameterPropertyDeclaration2.ts | 18 ++++++++++++++ ...indAllRefsParameterPropertyDeclaration3.ts | 18 ++++++++++++++ ...referenceInParameterPropertyDeclaration.ts | 24 +++++++++++++++++++ .../renameParameterPropertyDeclaration.ts | 17 ------------- .../renameParameterPropeterDeclaration1.ts | 14 +++++++++++ .../renameParameterPropeterDeclaration2.ts | 14 +++++++++++ .../renameParameterPropeterDeclaration3.ts | 14 +++++++++++ 9 files changed, 144 insertions(+), 17 deletions(-) create mode 100644 tests/cases/fourslash/documentHighlightAtParameterPropertyDeclaration.ts create mode 100644 tests/cases/fourslash/findAllRefsParameterPropertyDeclaration1.ts create mode 100644 tests/cases/fourslash/findAllRefsParameterPropertyDeclaration2.ts create mode 100644 tests/cases/fourslash/findAllRefsParameterPropertyDeclaration3.ts create mode 100644 tests/cases/fourslash/referenceInParameterPropertyDeclaration.ts delete mode 100644 tests/cases/fourslash/renameParameterPropertyDeclaration.ts create mode 100644 tests/cases/fourslash/renameParameterPropeterDeclaration1.ts create mode 100644 tests/cases/fourslash/renameParameterPropeterDeclaration2.ts create mode 100644 tests/cases/fourslash/renameParameterPropeterDeclaration3.ts diff --git a/tests/cases/fourslash/documentHighlightAtParameterPropertyDeclaration.ts b/tests/cases/fourslash/documentHighlightAtParameterPropertyDeclaration.ts new file mode 100644 index 00000000000..aeccd252fe9 --- /dev/null +++ b/tests/cases/fourslash/documentHighlightAtParameterPropertyDeclaration.ts @@ -0,0 +1,24 @@ +/// + +// @Filename: file1.ts +//// class Foo { +//// constructor(private /*0*/privateParam: number, +//// public /*1*/publicParam: string, +//// protected /*2*/protectedParam: boolean) { +//// +//// let localPrivate = /*3*/privateParam; +//// this./*4*/privateParam += 10; +//// +//// let localPublic = /*5*/publicParam; +//// this./*6*/publicParam += " Hello!"; +//// +//// let localProtected = /*7*/protectedParam; +//// this./*8*/protectedParam = false; +//// } +//// } + +let markers = test.markers() +for (let marker of markers) { + goTo.position(marker.position); + verify.documentHighlightsAtPositionCount(3, ["file1.ts"]); +} \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration1.ts b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration1.ts new file mode 100644 index 00000000000..d0854262828 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration1.ts @@ -0,0 +1,18 @@ +/// + +//// class Foo { +//// constructor(private |privateParam|: number) { +//// let localPrivate = |privateParam|; +//// this.|privateParam| += 10; +//// } +//// } + +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); + } +} \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration2.ts b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration2.ts new file mode 100644 index 00000000000..7e59567364a --- /dev/null +++ b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration2.ts @@ -0,0 +1,18 @@ +/// + +//// class Foo { +//// constructor(public |publicParam|: number) { +//// let localPublic = |publicParam|; +//// this.|publicParam| += 10; +//// } +//// } + +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); + } +} \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration3.ts b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration3.ts new file mode 100644 index 00000000000..2d78e9793f7 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration3.ts @@ -0,0 +1,18 @@ +/// + +//// class Foo { +//// constructor(protected |protectedParam|: number) { +//// let localProtected = |protectedParam|; +//// this.|protectedParam| += 10; +//// } +//// } + +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); + } +} \ No newline at end of file diff --git a/tests/cases/fourslash/referenceInParameterPropertyDeclaration.ts b/tests/cases/fourslash/referenceInParameterPropertyDeclaration.ts new file mode 100644 index 00000000000..4e86e7a4915 --- /dev/null +++ b/tests/cases/fourslash/referenceInParameterPropertyDeclaration.ts @@ -0,0 +1,24 @@ +/// + +// @Filename: file1.ts +//// class Foo { +//// constructor(private /*0*/privateParam: number, +//// public /*1*/publicParam: string, +//// protected /*2*/protectedParam: boolean) { +//// +//// let localPrivate = /*3*/privateParam; +//// this./*4*/privateParam += 10; +//// +//// let localPublic = /*5*/publicParam; +//// this./*6*/publicParam += " Hello!"; +//// +//// let localProtected = /*7*/protectedParam; +//// this./*8*/protectedParam = false; +//// } +//// } + +let markers = test.markers() +for (let marker of markers) { + goTo.position(marker.position); + verify.referencesCountIs(3); +} \ No newline at end of file diff --git a/tests/cases/fourslash/renameParameterPropertyDeclaration.ts b/tests/cases/fourslash/renameParameterPropertyDeclaration.ts deleted file mode 100644 index 34d8c9ef428..00000000000 --- a/tests/cases/fourslash/renameParameterPropertyDeclaration.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -//// class Foo { -//// constructor(private privateParam: number, -//// public publicParam: string, -//// protected protectedParam: boolean) { -//// -//// let localPrivate = privateParam; -//// this.privateParam += 10; -//// -//// let localPublic = publicParam; -//// this.publicParam += " Hello!"; -//// -//// let localProtected = protectedParam; -//// this.protectedParam = !this.protectedParam; -//// } -//// } \ No newline at end of file diff --git a/tests/cases/fourslash/renameParameterPropeterDeclaration1.ts b/tests/cases/fourslash/renameParameterPropeterDeclaration1.ts new file mode 100644 index 00000000000..1faed546d91 --- /dev/null +++ b/tests/cases/fourslash/renameParameterPropeterDeclaration1.ts @@ -0,0 +1,14 @@ +/// + +//// class Foo { +//// constructor(private |privateParam|: number) { +//// let localPrivate = |privateParam|; +//// this.|privateParam| += 10; +//// } +//// } + +let ranges = test.ranges() +for (let range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} \ No newline at end of file diff --git a/tests/cases/fourslash/renameParameterPropeterDeclaration2.ts b/tests/cases/fourslash/renameParameterPropeterDeclaration2.ts new file mode 100644 index 00000000000..e8eec5d3a0a --- /dev/null +++ b/tests/cases/fourslash/renameParameterPropeterDeclaration2.ts @@ -0,0 +1,14 @@ +/// + +//// class Foo { +//// constructor(public |publicParam|: number) { +//// let publicParam = |publicParam|; +//// this.|publicParam| += 10; +//// } +//// } + +let ranges = test.ranges() +for (let range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} \ No newline at end of file diff --git a/tests/cases/fourslash/renameParameterPropeterDeclaration3.ts b/tests/cases/fourslash/renameParameterPropeterDeclaration3.ts new file mode 100644 index 00000000000..44f4cf68858 --- /dev/null +++ b/tests/cases/fourslash/renameParameterPropeterDeclaration3.ts @@ -0,0 +1,14 @@ +/// + +//// class Foo { +//// constructor(protected |protectedParam|: number) { +//// let protectedParam = |protectedParam|; +//// this.|protectedParam| += 10; +//// } +//// } + +let ranges = test.ranges() +for (let range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} \ No newline at end of file