mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
tests/indent: move the run helper functions to top-level
This commit is contained in:
parent
63a88c873f
commit
db97170e4e
5 changed files with 38 additions and 37 deletions
|
|
@ -9,6 +9,13 @@ local opts = {
|
|||
expandtab = true,
|
||||
}
|
||||
|
||||
local run = function(file, spec, title)
|
||||
title = title and title or tostring(spec.on_line)
|
||||
it(string.format('%s[%s]', file, title), function()
|
||||
new_line('tests/indent/lua/' .. file, spec, opts)
|
||||
end)
|
||||
end
|
||||
|
||||
describe('indent Lua:', function()
|
||||
describe('whole file:', function()
|
||||
local files = scan_dir('tests/indent/lua');
|
||||
|
|
@ -20,13 +27,6 @@ describe('indent Lua:', function()
|
|||
end)
|
||||
|
||||
describe('new line:', function()
|
||||
local run = function(file, spec, title)
|
||||
title = title and title or tostring(spec.on_line)
|
||||
it(string.format('%s[%s]', file, title), function()
|
||||
new_line('tests/indent/lua/' .. file, spec, opts)
|
||||
end)
|
||||
end
|
||||
|
||||
run('comment.lua', { on_line = 1, text = 'line', indent = '-- ' })
|
||||
run('comment.lua', { on_line = 5, text = 'multiline', indent = ' ' })
|
||||
run('func.lua', { on_line = 1, text = 'x = x + 1', indent = 2 })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue