Added occurrences tests.
This commit is contained in:
parent
de0347fa0f
commit
a6788d22ef
2 changed files with 43 additions and 0 deletions
27
tests/cases/fourslash/server/occurrences01.ts
Normal file
27
tests/cases/fourslash/server/occurrences01.ts
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
/// <reference path="../fourslash.ts"/>
|
||||||
|
|
||||||
|
////foo: [|switch|] (10) {
|
||||||
|
//// [|case|] 1:
|
||||||
|
//// [|case|] 2:
|
||||||
|
//// [|case|] 3:
|
||||||
|
//// [|break|];
|
||||||
|
//// [|break|] foo;
|
||||||
|
//// co/*1*/ntinue;
|
||||||
|
//// contin/*2*/ue foo;
|
||||||
|
////}
|
||||||
|
|
||||||
|
let ranges = test.ranges();
|
||||||
|
|
||||||
|
for (let r of ranges) {
|
||||||
|
goTo.position(r.start);
|
||||||
|
verify.occurrencesAtPositionCount(ranges.length);
|
||||||
|
|
||||||
|
for (let range of ranges) {
|
||||||
|
verify.occurrencesAtPositionContains(range, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let m of test.markers()) {
|
||||||
|
goTo.position(m.position);
|
||||||
|
verify.occurrencesAtPositionCount(0);
|
||||||
|
}
|
16
tests/cases/fourslash/server/occurrences02.ts
Normal file
16
tests/cases/fourslash/server/occurrences02.ts
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/// <reference path="../fourslash.ts"/>
|
||||||
|
|
||||||
|
////function [|f|](x: typeof [|f|]) {
|
||||||
|
//// [|f|]([|f|]);
|
||||||
|
////}
|
||||||
|
|
||||||
|
let ranges = test.ranges();
|
||||||
|
|
||||||
|
for (let r of ranges) {
|
||||||
|
goTo.position(r.start);
|
||||||
|
verify.occurrencesAtPositionCount(ranges.length);
|
||||||
|
|
||||||
|
for (let range of ranges) {
|
||||||
|
verify.occurrencesAtPositionContains(range, false);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue