mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
add compound_lit.c test
This commit is contained in:
parent
1a4b5da758
commit
1dea3928a2
2 changed files with 11 additions and 0 deletions
10
tests/indent/c/compound_lit.c
Normal file
10
tests/indent/c/compound_lit.c
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
struct foo {
|
||||||
|
int x, y;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct foo bar(int x, int y) {
|
||||||
|
return (struct foo) {
|
||||||
|
.x = x,
|
||||||
|
.y = y
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -14,6 +14,7 @@ describe("indent C:", function()
|
||||||
|
|
||||||
describe("new line:", function()
|
describe("new line:", function()
|
||||||
runner:new_line("array.c", { on_line = 2, text = "0,", indent = 4 })
|
runner:new_line("array.c", { on_line = 2, text = "0,", indent = 4 })
|
||||||
|
runner:new_line("compound_lit.c", { on_line = 7, text = ".z = 5,", indent = 8 })
|
||||||
runner:new_line("cond.c", { on_line = 3, text = "x++;", indent = 8 })
|
runner:new_line("cond.c", { on_line = 3, text = "x++;", indent = 8 })
|
||||||
runner:new_line("cond.c", { on_line = 8, text = "x++;", indent = 8 })
|
runner:new_line("cond.c", { on_line = 8, text = "x++;", indent = 8 })
|
||||||
runner:new_line("expr.c", { on_line = 10, text = "2 *", indent = 8 })
|
runner:new_line("expr.c", { on_line = 10, text = "2 *", indent = 8 })
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue