mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Added more test cases for highlighting abstract keyword
This commit is contained in:
parent
fc47329ed2
commit
2718539588
@ -1,6 +1,8 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////[|abstract|] class Animal {
|
||||
//// [|abstract|] prop1; // Does not compile
|
||||
//// [|abstract|] abstract();
|
||||
//// [|abstract|] walk(): void;
|
||||
//// [|abstract|] makeSound(): void;
|
||||
////}
|
||||
@ -12,11 +14,11 @@
|
||||
|
||||
const ranges = test.ranges();
|
||||
|
||||
for(let r of ranges) {
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(ranges.length);
|
||||
|
||||
for(let range of ranges) {
|
||||
for (let range of ranges) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
}
|
||||
}
|
||||
29
tests/cases/fourslash/getOccurrencesAbstract02.ts
Normal file
29
tests/cases/fourslash/getOccurrencesAbstract02.ts
Normal file
@ -0,0 +1,29 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////// Not valid TS (abstract methods can only appear in abstract classes)
|
||||
////class Animal {
|
||||
//// [|abstract|] walk(): void;
|
||||
//// [|abstract|] makeSound(): void;
|
||||
////}
|
||||
////// abstract cannot appear here, won't get highlighted
|
||||
////let c = /*1*/abstract class Foo {
|
||||
//// /*2*/abstract foo(): void;
|
||||
//// abstract bar(): void;
|
||||
////}
|
||||
|
||||
const 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);
|
||||
}
|
||||
}
|
||||
|
||||
goTo.marker("1");
|
||||
verify.occurrencesAtPositionCount(0);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.occurrencesAtPositionCount(2);
|
||||
Loading…
x
Reference in New Issue
Block a user