mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
Add tests for find-all-references
This commit is contained in:
parent
66a0f1d2ea
commit
8cebdcc758
15
tests/cases/fourslash/referencesForInheritedProperties3.ts
Normal file
15
tests/cases/fourslash/referencesForInheritedProperties3.ts
Normal file
@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// interface interface1 extends interface1 {
|
||||
//// /*1*/doStuff(): void;
|
||||
//// /*2*/propName: string;
|
||||
//// }
|
||||
////
|
||||
//// var v: interface1;
|
||||
//// v./*3*/propName;
|
||||
//// v./*4*/doStuff();
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(2);
|
||||
});
|
||||
15
tests/cases/fourslash/referencesForInheritedProperties4.ts
Normal file
15
tests/cases/fourslash/referencesForInheritedProperties4.ts
Normal file
@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class class1 extends class1 {
|
||||
//// /*1*/doStuff() { }
|
||||
//// /*2*/propName: string;
|
||||
//// }
|
||||
////
|
||||
//// var c: class1;
|
||||
//// c./*3*/doStuff();
|
||||
//// c./*4*/propName;
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(2);
|
||||
});
|
||||
19
tests/cases/fourslash/referencesForInheritedProperties5.ts
Normal file
19
tests/cases/fourslash/referencesForInheritedProperties5.ts
Normal file
@ -0,0 +1,19 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// interface interface1 extends interface1 {
|
||||
//// /*1*/doStuff(): void;
|
||||
//// /*2*/propName: string;
|
||||
//// }
|
||||
//// interface interface2 extends interface1 {
|
||||
//// /*3*/doStuff(): void;
|
||||
//// /*4*/propName: string;
|
||||
//// }
|
||||
////
|
||||
//// var v: interface1;
|
||||
//// v./*5*/propName;
|
||||
//// v./*6*/doStuff();
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.referencesCountIs(3);
|
||||
});
|
||||
32
tests/cases/fourslash/referencesForInheritedProperties6.ts
Normal file
32
tests/cases/fourslash/referencesForInheritedProperties6.ts
Normal file
@ -0,0 +1,32 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class class1 extends class1 {
|
||||
//// /*1*/doStuff() { }
|
||||
//// /*2*/propName: string;
|
||||
//// }
|
||||
//// class class2 extends class1 {
|
||||
//// /*3*/doStuff() { }
|
||||
//// /*4*/propName: string;
|
||||
//// }
|
||||
////
|
||||
//// var v: class2;
|
||||
//// v./*5*/propName;
|
||||
//// v./*6*/doStuff();
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(1);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("5");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("6");
|
||||
verify.referencesCountIs(2);
|
||||
42
tests/cases/fourslash/referencesForInheritedProperties7.ts
Normal file
42
tests/cases/fourslash/referencesForInheritedProperties7.ts
Normal file
@ -0,0 +1,42 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// class class1 extends class1 {
|
||||
//// /*1*/doStuff() { }
|
||||
//// /*2*/propName: string;
|
||||
//// }
|
||||
//// interface interface1 extends interface1 {
|
||||
//// /*3*/doStuff(): void;
|
||||
//// /*4*/propName: string;
|
||||
//// }
|
||||
//// class class2 extends class1 implements interface1 {
|
||||
//// /*5*/doStuff() { }
|
||||
//// /*6*/propName: string;
|
||||
//// }
|
||||
////
|
||||
//// var v: class2;
|
||||
//// v./*7*/propName;
|
||||
//// v./*8*/doStuff();
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(1);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("3");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("4");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("5");
|
||||
verify.referencesCountIs(3);
|
||||
|
||||
goTo.marker("6");
|
||||
verify.referencesCountIs(4);
|
||||
|
||||
goTo.marker("7");
|
||||
verify.referencesCountIs(4);
|
||||
|
||||
goTo.marker("8");
|
||||
verify.referencesCountIs(3);
|
||||
Loading…
x
Reference in New Issue
Block a user