Added more test cases for highlighting abstract keyword

This commit is contained in:
Dick van den Brink 2015-07-14 01:39:39 +02:00
parent fc47329ed2
commit 2718539588
2 changed files with 33 additions and 2 deletions

View File

@ -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);
}
}

View 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);