mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
Use stylua for autoformat code (#1480)
This commit is contained in:
parent
90f15d9bf7
commit
be8f656087
32 changed files with 1181 additions and 979 deletions
|
|
@ -1,35 +1,35 @@
|
|||
local Runner = require('tests.indent.common').Runner
|
||||
local Runner = require("tests.indent.common").Runner
|
||||
|
||||
local runner = Runner:new(it, 'tests/indent/c', {
|
||||
local runner = Runner:new(it, "tests/indent/c", {
|
||||
tabstop = 4,
|
||||
shiftwidth = 4,
|
||||
softtabstop = 0,
|
||||
expandtab = true,
|
||||
})
|
||||
|
||||
describe('indent C:', function()
|
||||
describe('whole file:', function()
|
||||
runner:whole_file('.')
|
||||
describe("indent C:", function()
|
||||
describe("whole file:", function()
|
||||
runner:whole_file "."
|
||||
end)
|
||||
|
||||
describe('new line:', function()
|
||||
runner:new_line('array.c', { on_line = 2, text = '0,', indent = 4 })
|
||||
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 })
|
||||
runner:new_line('func.c', { on_line = 17, text = 'int z,', indent = 4 })
|
||||
runner:new_line('label.c', { on_line = 3, text = 'normal:', indent = 0 })
|
||||
runner:new_line('loop.c', { on_line = 3, text = 'x++;', indent = 8 })
|
||||
runner:new_line('preproc_cond.c', { on_line = 5, text = 'x++;', indent = 4 })
|
||||
runner:new_line('preproc_func.c', { on_line = 3, text = 'x++; \\', indent = 8 })
|
||||
runner:new_line('string.c', { on_line = 1, text = 'brave new \\', indent = 0 })
|
||||
runner:new_line('string.c', { on_line = 4, text = '"brave new "', indent = 4 })
|
||||
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 })
|
||||
describe("new line:", function()
|
||||
runner:new_line("array.c", { on_line = 2, text = "0,", indent = 4 })
|
||||
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 })
|
||||
runner:new_line("func.c", { on_line = 17, text = "int z,", indent = 4 })
|
||||
runner:new_line("label.c", { on_line = 3, text = "normal:", indent = 0 })
|
||||
runner:new_line("loop.c", { on_line = 3, text = "x++;", indent = 8 })
|
||||
runner:new_line("preproc_cond.c", { on_line = 5, text = "x++;", indent = 4 })
|
||||
runner:new_line("preproc_func.c", { on_line = 3, text = "x++; \\", indent = 8 })
|
||||
runner:new_line("string.c", { on_line = 1, text = "brave new \\", indent = 0 })
|
||||
runner:new_line("string.c", { on_line = 4, text = '"brave new "', indent = 4 })
|
||||
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 })
|
||||
-- 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 })
|
||||
runner:new_line('no_braces.c', { on_line = 10, text = 'x++;', indent = 8 })
|
||||
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 })
|
||||
runner:new_line("no_braces.c", { on_line = 10, text = "x++;", indent = 8 })
|
||||
end)
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue