diff options
| -rw-r--r-- | tests/indent/c/issue-1568.c | 6 | ||||
| -rw-r--r-- | tests/indent/c_spec.lua | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/indent/c/issue-1568.c b/tests/indent/c/issue-1568.c new file mode 100644 index 000000000..c5d756610 --- /dev/null +++ b/tests/indent/c/issue-1568.c @@ -0,0 +1,6 @@ +int main() { + if (1) { + foobar(); + } else { + } +} diff --git a/tests/indent/c_spec.lua b/tests/indent/c_spec.lua index 2c19ba774..250e05136 100644 --- a/tests/indent/c_spec.lua +++ b/tests/indent/c_spec.lua @@ -36,6 +36,7 @@ describe("indent C:", function() runner:new_line("struct.c", { on_line = 4, text = "int y;", indent = 8 }) runner:new_line("switch.c", { on_line = 3, text = "x++;", indent = 12 }) runner:new_line("ternary.c", { on_line = 4, text = ": (x == 0) : 0", indent = 8 }) + runner:new_line("issue-1568.c", { on_line = 4, text = "x++;", indent = 8 }) -- the line after inserted one will be left with wrong indent but we only care about the inserted one runner:new_line("no_braces.c", { on_line = 4, text = "x++;", indent = 8 }) runner:new_line("no_braces.c", { on_line = 7, text = "x++;", indent = 8 }) |
