mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
Added tests.
This commit is contained in:
parent
1f77198c4c
commit
8ab4df0e25
55
tests/cases/fourslash/getOccurrencesTryCatchFinallyBroken.ts
Normal file
55
tests/cases/fourslash/getOccurrencesTryCatchFinallyBroken.ts
Normal file
@ -0,0 +1,55 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////t /*1*/ry {
|
||||
//// t/*2*/ry {
|
||||
//// }
|
||||
//// ctch (x) {
|
||||
//// }
|
||||
////
|
||||
//// tr {
|
||||
//// }
|
||||
//// fin/*3*/ally {
|
||||
//// }
|
||||
////}
|
||||
////c/*4*/atch (e) {
|
||||
////}
|
||||
////f/*5*/inally {
|
||||
////}
|
||||
////
|
||||
////// Missing catch variable
|
||||
////t/*6*/ry {
|
||||
////}
|
||||
////catc/*7*/h {
|
||||
////}
|
||||
/////*8*/finally {
|
||||
////}
|
||||
////
|
||||
////// Missing try entirely
|
||||
////cat/*9*/ch (x) {
|
||||
////}
|
||||
////final/*10*/ly {
|
||||
////}
|
||||
|
||||
|
||||
for (var i = 1; i <= test.markers().length; i++) {
|
||||
goTo.marker("" + i);
|
||||
|
||||
switch (i) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
verify.occurrencesAtPositionCount(1);
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
case 9:
|
||||
case 10:
|
||||
verify.occurrencesAtPositionCount(2);
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
verify.occurrencesAtPositionCount(3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////try/*1*/ {
|
||||
//// try/*2*/ {
|
||||
//// }
|
||||
//// catch/*3*/ (x) {
|
||||
//// }
|
||||
////
|
||||
//// try/*4*/ {
|
||||
//// }
|
||||
//// finally/*5*/ {/*8*/
|
||||
//// }
|
||||
////}
|
||||
////catch/*6*/ (e) {
|
||||
////}
|
||||
////finally/*7*/ {
|
||||
////}
|
||||
|
||||
|
||||
for (var i = 1; i <= test.markers().length; i++) {
|
||||
goTo.marker("" + i);
|
||||
verify.occurrencesAtPositionCount(0);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user