Skip to content

Commit 486155f

Browse files
Add fourslash tests
1 parent d0d7347 commit 486155f

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
////let foo = 1;
4+
////switch (foo) {
5+
/////*1*/case 0:
6+
/////*2*/break;
7+
/////*3*/default:
8+
/////*4*/break;
9+
////}
10+
11+
format.setOption('indentSwitchCase', true);
12+
format.document();
13+
goTo.marker('1');
14+
verify.indentationIs(4);
15+
goTo.marker('2');
16+
verify.indentationIs(8);
17+
goTo.marker('3');
18+
verify.indentationIs(4);
19+
goTo.marker('4');
20+
verify.indentationIs(8);
21+
22+
format.setOption('indentSwitchCase', false);
23+
format.document();
24+
goTo.marker('1');
25+
verify.indentationIs(0);
26+
goTo.marker('2');
27+
verify.indentationIs(4);
28+
goTo.marker('3');
29+
verify.indentationIs(0);
30+
goTo.marker('4');
31+
verify.indentationIs(4);

tests/cases/fourslash/fourslash.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ declare namespace FourSlashInterface {
196196
readonly insertSpaceBeforeTypeAnnotation?: boolean;
197197
readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean;
198198
readonly semicolons?: ts.SemicolonPreference;
199+
readonly indentSwitchCase?: boolean;
199200
}
200201
interface Range {
201202
fileName: string;

0 commit comments

Comments
 (0)