From 46292a2263adc49e5644046b710a72ada91d569e Mon Sep 17 00:00:00 2001 From: Dick van den Brink Date: Wed, 15 Jul 2015 00:18:59 +0200 Subject: [PATCH] Add test for occurrences in ClassExpressions --- ...etOccurrencesClassExpressionConstructor.ts | 23 +++++++++++++++ .../getOccurrencesClassExpressionPrivate.ts | 27 +++++++++++++++++ .../getOccurrencesClassExpressionPublic.ts | 27 +++++++++++++++++ .../getOccurrencesClassExpressionStatic.ts | 29 +++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 tests/cases/fourslash/getOccurrencesClassExpressionConstructor.ts create mode 100644 tests/cases/fourslash/getOccurrencesClassExpressionPrivate.ts create mode 100644 tests/cases/fourslash/getOccurrencesClassExpressionPublic.ts create mode 100644 tests/cases/fourslash/getOccurrencesClassExpressionStatic.ts diff --git a/tests/cases/fourslash/getOccurrencesClassExpressionConstructor.ts b/tests/cases/fourslash/getOccurrencesClassExpressionConstructor.ts new file mode 100644 index 00000000000..5fa778ef8cd --- /dev/null +++ b/tests/cases/fourslash/getOccurrencesClassExpressionConstructor.ts @@ -0,0 +1,23 @@ +/// + +////let A = class Foo { +//// [|constructor|](); +//// [|constructor|](x: number); +//// [|constructor|](y: string); +//// [|constructor|](a?: any) { +//// } +////} +//// +////let B = class D { +//// constructor(x: number) { +//// } +////} + +const ranges = test.ranges(); +for (let r of ranges) { + goTo.position(r.start); + + for (let range of ranges) { + verify.occurrencesAtPositionContains(range, false); + } +} diff --git a/tests/cases/fourslash/getOccurrencesClassExpressionPrivate.ts b/tests/cases/fourslash/getOccurrencesClassExpressionPrivate.ts new file mode 100644 index 00000000000..b008ec237b8 --- /dev/null +++ b/tests/cases/fourslash/getOccurrencesClassExpressionPrivate.ts @@ -0,0 +1,27 @@ +/// + +////let A = class Foo { +//// [|private|] foo; +//// [|private|] private; +//// constructor([|private|] y: string, public x: string) { +//// } +//// [|private|] method() { } +//// public method2() { } +//// [|private|] static static() { } +////} +//// +////let B = class D { +//// constructor(private x: number) { +//// } +//// private test() {} +//// public test2() {} +////} + +const ranges = test.ranges(); +for (let r of ranges) { + goTo.position(r.start); + + for (let range of ranges) { + verify.occurrencesAtPositionContains(range, false); + } +} diff --git a/tests/cases/fourslash/getOccurrencesClassExpressionPublic.ts b/tests/cases/fourslash/getOccurrencesClassExpressionPublic.ts new file mode 100644 index 00000000000..3070fd4f6ca --- /dev/null +++ b/tests/cases/fourslash/getOccurrencesClassExpressionPublic.ts @@ -0,0 +1,27 @@ +/// + +////let A = class Foo { +//// [|public|] foo; +//// [|public|] public; +//// constructor([|public|] y: string, private x: string) { +//// } +//// [|public|] method() { } +//// private method2() {} +//// [|public|] static static() { } +////} +//// +////let B = class D { +//// constructor(private x: number) { +//// } +//// private test() {} +//// public test2() {} +////} + +const ranges = test.ranges(); +for (let r of ranges) { + goTo.position(r.start); + + for (let range of ranges) { + verify.occurrencesAtPositionContains(range, false); + } +} diff --git a/tests/cases/fourslash/getOccurrencesClassExpressionStatic.ts b/tests/cases/fourslash/getOccurrencesClassExpressionStatic.ts new file mode 100644 index 00000000000..567c0c4eccd --- /dev/null +++ b/tests/cases/fourslash/getOccurrencesClassExpressionStatic.ts @@ -0,0 +1,29 @@ +/// + +////let A = class Foo { +//// public static foo; +//// [|static|] a; +//// constructor(public y: string, private x: string) { +//// } +//// public method() { } +//// private method2() {} +//// public [|static|] static() { } +//// private [|static|] static2() { } +////} +//// +////let B = class D { +//// static a; +//// constructor(private x: number) { +//// } +//// private static test() {} +//// public static test2() {} +////} + +const ranges = test.ranges(); +for (let r of ranges) { + goTo.position(r.start); + + for (let range of ranges) { + verify.occurrencesAtPositionContains(range, false); + } +}