8000 Split occurrences test for 'abstract' into two different tests. · predever/TypeScript@1d89a10 · GitHub
[go: up one dir, main page]

10000
Skip to content

Commit 1d89a10

Browse files
Split occurrences test for 'abstract' into two different tests.
1 parent c5aa3ad commit 1d89a10

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed
Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
11
/// <reference path='fourslash.ts' />
22

3-
////// Not valid TS (abstract methods can only appear in abstract classes)
43
////class Animal {
54
//// [|abstract|] walk(): void;
65
//// [|abstract|] makeSound(): void;
76
////}
8-
////// abstract cannot appear here, won't get highlighted
9-
////let c = /*1*/abstract class Foo {
10-
//// /*2*/abstract foo(): void;
11-
//// abstract bar(): void;
12-
////}
137

14-
const ranges = test.ranges();
158

9+
// Still highlight occurrences even though abstract methods can only appear in abstract classes
10+
const ranges = test.ranges();
1611
for (let r of ranges) {
1712
goTo.position(r.start);
1813
verify.occurrencesAtPositionCount(ranges.length);
1914

2015
for (let range of ranges) {
2116
verify.occurrencesAtPositionContains(range, false);
2217
}
23-
}
24-
25-
goTo.marker("1");
26-
verify.occurrencesAtPositionCount(0);
27-
28-
goTo.marker("2");
29-
verify.occurrencesAtPositionCount(2);
18+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
////// Abstract cannot appear here, won't get highlighted
4+
////let c = /**/abstract class Foo {
5+
//// [|abstract|] foo(): void;
6+
//// [|abstract|] bar(): void;
7+
////}
8+
9+
goTo.marker("1");
10+
verify.occurrencesAtPositionCount(0);
11+
12+
// Still highlight occurrences even though abstract methods can only appear in abstract classes
13+
const ranges = test.ranges();
14+
for (let r of ranges) {
15+
goTo.position(r.start);
16+
verify.occurrencesAtPositionCount(ranges.length);
17+
18+
for (let range of ranges) {
19+
verify.occurrencesAtPositionContains(range, false);
20+
}
21+
}

0 commit comments

Comments
 (0)
0