mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 11:54:44 -06:00
Added occurrences tests.
This commit is contained in:
parent
de0347fa0f
commit
a6788d22ef
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…
x
Reference in New Issue
Block a user