mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
Added more tests.
This commit is contained in:
parent
be3c544e9d
commit
62ec1fc0bd
72
tests/cases/fourslash/getOccurrencesDeclare3.ts
Normal file
72
tests/cases/fourslash/getOccurrencesDeclare3.ts
Normal file
@ -0,0 +1,72 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////
|
||||
////[|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);
|
||||
});
|
||||
});
|
||||
72
tests/cases/fourslash/getOccurrencesExport3.ts
Normal file
72
tests/cases/fourslash/getOccurrencesExport3.ts
Normal file
@ -0,0 +1,72 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////
|
||||
////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);
|
||||
});
|
||||
});
|
||||
41
tests/cases/fourslash/getOccurrencesModifiersNegatives1.ts
Normal file
41
tests/cases/fourslash/getOccurrencesModifiersNegatives1.ts
Normal file
@ -0,0 +1,41 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////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);
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user