From 62ec1fc0bdc9061add975aba9bd96f2abdf4f33b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 20 Nov 2014 12:30:10 -0800 Subject: [PATCH] Added more tests. --- .../cases/fourslash/getOccurrencesDeclare3.ts | 72 +++++++++++++++++++ .../cases/fourslash/getOccurrencesExport3.ts | 72 +++++++++++++++++++ .../getOccurrencesModifiersNegatives1.ts | 41 +++++++++++ 3 files changed, 185 insertions(+) create mode 100644 tests/cases/fourslash/getOccurrencesDeclare3.ts create mode 100644 tests/cases/fourslash/getOccurrencesExport3.ts create mode 100644 tests/cases/fourslash/getOccurrencesModifiersNegatives1.ts diff --git a/tests/cases/fourslash/getOccurrencesDeclare3.ts b/tests/cases/fourslash/getOccurrencesDeclare3.ts new file mode 100644 index 00000000000..048dd8efeac --- /dev/null +++ b/tests/cases/fourslash/getOccurrencesDeclare3.ts @@ -0,0 +1,72 @@ +/// + +//// +////[|declare|] var x; +////export [|declare|] var y, z; +//// +////module m { +//// export class C1 { +//// public pub1; +//// public pub2; +//// private priv1; +//// private priv2; +//// protected prot1; +//// protected prot2; +//// +//// public public; +//// private private; +//// protected protected; +//// +//// public constructor(public a, private b, protected c, public d, private e, protected f) { +//// this.public = 10; +//// this.private = 10; +//// this.protected = 10; +//// } +//// +//// public get x() { return 10; } +//// public set x(value) { } +//// +//// public static statPub; +//// private static statPriv; +//// protected static statProt; +//// } +//// +//// export interface I1 { +//// } +//// +//// export declare module ma.m1.m2.m3 { +//// interface I2 { +//// } +//// } +//// +//// export module mb.m1.m2.m3 { +//// declare var foo; +//// +//// export class C2 { +//// public pub1; +//// private priv1; +//// protected prot1; +//// +//// protected constructor(public public, protected protected, private private) { +//// public = private = protected; +//// } +//// } +//// } +//// +//// declare var ambientThing: number; +//// export var exportedThing = 10; +//// declare function foo(): string; +////} +//// +////[|declare|] export var v1, v2; +////[|declare|] module dm { } +////export class EC { } + +test.ranges().forEach(r => { + goTo.position(r.start); + verify.occurrencesAtPositionCount(test.ranges().length); + + test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); + }); +}); diff --git a/tests/cases/fourslash/getOccurrencesExport3.ts b/tests/cases/fourslash/getOccurrencesExport3.ts new file mode 100644 index 00000000000..009b891992f --- /dev/null +++ b/tests/cases/fourslash/getOccurrencesExport3.ts @@ -0,0 +1,72 @@ +/// + +//// +////declare var x; +////[|export|] declare var y, z; +//// +////module m { +//// export class C1 { +//// public pub1; +//// public pub2; +//// private priv1; +//// private priv2; +//// protected prot1; +//// protected prot2; +//// +//// public public; +//// private private; +//// protected protected; +//// +//// public constructor(public a, private b, protected c, public d, private e, protected f) { +//// this.public = 10; +//// this.private = 10; +//// this.protected = 10; +//// } +//// +//// public get x() { return 10; } +//// public set x(value) { } +//// +//// public static statPub; +//// private static statPriv; +//// protected static statProt; +//// } +//// +//// export interface I1 { +//// } +//// +//// export declare module ma.m1.m2.m3 { +//// interface I2 { +//// } +//// } +//// +//// export module mb.m1.m2.m3 { +//// declare var foo; +//// +//// export class C2 { +//// public pub1; +//// private priv1; +//// protected prot1; +//// +//// protected constructor(public public, protected protected, private private) { +//// public = private = protected; +//// } +//// } +//// } +//// +//// declare var ambientThing: number; +//// export var exportedThing = 10; +//// declare function foo(): string; +////} +//// +////declare [|export|] var v1, v2; +////declare module dm { } +////[|export|] class EC { } + +test.ranges().forEach(r => { + goTo.position(r.start); + verify.occurrencesAtPositionCount(test.ranges().length); + + test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); + }); +}); diff --git a/tests/cases/fourslash/getOccurrencesModifiersNegatives1.ts b/tests/cases/fourslash/getOccurrencesModifiersNegatives1.ts new file mode 100644 index 00000000000..ac74fc2192f --- /dev/null +++ b/tests/cases/fourslash/getOccurrencesModifiersNegatives1.ts @@ -0,0 +1,41 @@ +/// + +////class C { +//// [|export|] foo; +//// [|declare|] bar; +//// [|export|] [|declare|] foobar; +//// [|declare|] [|export|] barfoo; +//// +//// constructor([|export|] conFoo, +//// [|declare|] conBar, +//// [|export|] [|declare|] conFooBar, +//// [|declare|] [|export|] conBarFoo, +//// [|static|] sue, +//// [|static|] [|export|] [|declare|] sueFooBar, +//// [|static|] [|declare|] [|export|] sueBarFoo, +//// [|declare|] [|static|] [|export|] barSueFoo) { +//// } +////} +//// +////module m { +//// [|static|] a; +//// [|public|] b; +//// [|private|] c; +//// [|protected|] d; +//// [|static|] [|public|] [|private|] [|protected|] e; +//// [|public|] [|static|] [|protected|] [|private|] f; +//// [|protected|] [|static|] [|public|] g; +////} +////[|static|] a; +////[|public|] b; +////[|private|] c; +////[|protected|] d; +////[|static|] [|public|] [|private|] [|protected|] e; +////[|public|] [|static|] [|protected|] [|private|] f; +////[|protected|] [|static|] [|public|] g; + + +test.ranges().forEach(r => { + goTo.position(r.start); + verify.occurrencesAtPositionCount(0); +});