mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-07-02 14:48:32 -05:00
Modified tests and added a test for labeled continues in a switch block.
This commit is contained in:
@@ -65,6 +65,7 @@
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
@@ -72,6 +73,7 @@ test.ranges().forEach(r => {
|
||||
});
|
||||
|
||||
goTo.marker();
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
@@ -65,6 +65,7 @@
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
@@ -72,6 +73,7 @@ test.ranges().forEach(r => {
|
||||
});
|
||||
|
||||
goTo.marker();
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
@@ -65,6 +65,7 @@
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
@@ -72,6 +73,7 @@ test.ranges().forEach(r => {
|
||||
});
|
||||
|
||||
goTo.marker();
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
@@ -65,6 +65,7 @@
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
@@ -72,6 +73,7 @@ test.ranges().forEach(r => {
|
||||
});
|
||||
|
||||
goTo.marker();
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
@@ -1,10 +1,10 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////[|sw/*1*/itch|] (10) {
|
||||
//// [|/*2*/case|] 1:
|
||||
//// [|cas/*3*/e|] 2:
|
||||
//// [|c/*4*/ase|] 4:
|
||||
//// [|c/*5*/ase|] 8:
|
||||
////[|switch|] (10) {
|
||||
//// [|case|] 1:
|
||||
//// [|case|] 2:
|
||||
//// [|case|] 4:
|
||||
//// [|case|] 8:
|
||||
//// foo: switch (20) {
|
||||
//// case 1:
|
||||
//// case 2:
|
||||
@@ -12,18 +12,18 @@
|
||||
//// default:
|
||||
//// break foo;
|
||||
//// }
|
||||
//// [|cas/*6*/e|] 0xBEEF:
|
||||
//// [|defa/*7*/ult|]:
|
||||
//// [|bre/*9*/ak|];
|
||||
//// [|/*8*/case|] 16:
|
||||
//// [|case|] 0xBEEF:
|
||||
//// [|default|]:
|
||||
//// [|break|];
|
||||
//// [|case|] 16:
|
||||
////}
|
||||
|
||||
|
||||
for (var i = 1; i <= test.markers().length; i++) {
|
||||
goTo.marker("" + i);
|
||||
verify.occurrencesAtPositionCount(9);
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
//// case 2:
|
||||
//// case 4:
|
||||
//// case 8:
|
||||
//// foo: [|swi/*1*/tch|] (20) {
|
||||
//// [|/*2*/case|] 1:
|
||||
//// [|cas/*3*/e|] 2:
|
||||
//// [|b/*4*/reak|];
|
||||
//// [|defaul/*5*/t|]:
|
||||
//// foo: [|switch|] (20) {
|
||||
//// [|case|] 1:
|
||||
//// [|case|] 2:
|
||||
//// [|break|];
|
||||
//// [|default|]:
|
||||
//// [|break|] foo;
|
||||
//// }
|
||||
//// case 0xBEEF:
|
||||
@@ -21,18 +21,9 @@
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
for (var i = 1; i <= test.markers().length; i++) {
|
||||
goTo.marker("" + i);
|
||||
verify.occurrencesAtPositionCount(6);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
|
||||
25
tests/cases/fourslash/getOccurrencesSwitchCaseDefault4.ts
Normal file
25
tests/cases/fourslash/getOccurrencesSwitchCaseDefault4.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////foo: [|switch|] (10) {
|
||||
//// [|case|] 1:
|
||||
//// [|case|] 2:
|
||||
//// [|case|] 3:
|
||||
//// [|break|];
|
||||
//// [|break|] foo;
|
||||
//// co/*1*/ntinue;
|
||||
//// contin/*2*/ue foo;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.occurrencesAtPositionCount(0);
|
||||
});
|
||||
Reference in New Issue
Block a user