Adding test case for when case block starts on new line

This commit is contained in:
Sheetal Nandi 2016-10-07 15:23:32 -07:00
Родитель 6e4b81f40f
Коммит 0ec5ae9ca9
2 изменённых файлов: 68 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,62 @@
original file
-----------------------------------
switch (0) {
case 0: {
const zero = 0;
return zero;
}
}
-----------------------------------
Grammar: TypeScript.tmLanguage
-----------------------------------
>switch (0) {
^^^^^^
source.ts switch-statement.expr.ts switch-expression.expr.ts keyword.control.switch.ts
^
source.ts switch-statement.expr.ts switch-expression.expr.ts
^
source.ts switch-statement.expr.ts switch-expression.expr.ts meta.brace.round.ts
^
source.ts switch-statement.expr.ts switch-expression.expr.ts constant.numeric.decimal.ts
^
source.ts switch-statement.expr.ts switch-expression.expr.ts meta.brace.round.ts
^
source.ts switch-statement.expr.ts
^
source.ts switch-statement.expr.ts switch-block.expr.ts punctuation.definition.block.ts
^^
source.ts switch-statement.expr.ts switch-block.expr.ts
> case 0: {
^^^^
source.ts switch-statement.expr.ts switch-block.expr.ts
^^^^
source.ts switch-statement.expr.ts switch-block.expr.ts case-clause.expr.ts keyword.control.switch.ts
^
source.ts switch-statement.expr.ts switch-block.expr.ts case-clause.expr.ts
^
source.ts switch-statement.expr.ts switch-block.expr.ts case-clause.expr.ts constant.numeric.decimal.ts
^
source.ts switch-statement.expr.ts switch-block.expr.ts case-clause.expr.ts
^
source.ts switch-statement.expr.ts switch-block.expr.ts meta.object-literal.ts
^
source.ts switch-statement.expr.ts switch-block.expr.ts meta.object-literal.ts punctuation.definition.block.ts
^^
source.ts switch-statement.expr.ts switch-block.expr.ts meta.object-literal.ts
> const zero = 0;
^^^^^^^^^^^^^^^^^^^^^^^^^
source.ts switch-statement.expr.ts switch-block.expr.ts meta.object-literal.ts
> return zero;
^^^^^^^^^^^^^^^^^^^^^^
source.ts switch-statement.expr.ts switch-block.expr.ts meta.object-literal.ts
> }
^^^^
source.ts switch-statement.expr.ts switch-block.expr.ts meta.object-literal.ts
^
source.ts switch-statement.expr.ts switch-block.expr.ts meta.object-literal.ts punctuation.definition.block.ts
^^
source.ts switch-statement.expr.ts switch-block.expr.ts
>}
^
source.ts switch-statement.expr.ts punctuation.definition.block.ts

6
tests/cases/Issue294.ts Normal file
Просмотреть файл

@ -0,0 +1,6 @@
switch (0) {
case 0: {
const zero = 0;
return zero;
}
}