diff options
| -rw-r--r-- | tests/indent/c/compound_lit.c | 10 | ||||
| -rw-r--r-- | tests/indent/c_spec.lua | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/indent/c/compound_lit.c b/tests/indent/c/compound_lit.c new file mode 100644 index 00000000..29e336f5 --- /dev/null +++ b/tests/indent/c/compound_lit.c @@ -0,0 +1,10 @@ +struct foo { + int x, y; +}; + +struct foo bar(int x, int y) { + return (struct foo) { + .x = x, + .y = y + }; +} diff --git a/tests/indent/c_spec.lua b/tests/indent/c_spec.lua index f48cbd0a..1bdd0165 100644 --- a/tests/indent/c_spec.lua +++ b/tests/indent/c_spec.lua @@ -14,6 +14,7 @@ describe("indent C:", function() describe("new line:", function() 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 = 8, text = "x++;", indent = 8 }) runner:new_line("expr.c", { on_line = 10, text = "2 *", indent = 8 }) |
