mirror of
https://github.com/chenasraf/nvim-treesitter.git
synced 2026-05-18 01:39:00 +00:00
tests/indent: move the run helper functions to top-level
This commit is contained in:
@@ -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/python/' .. file, spec, opts)
|
||||
end)
|
||||
end
|
||||
|
||||
describe('indent Python:', function()
|
||||
describe('whole file:', function()
|
||||
local files = scan_dir('tests/indent/python');
|
||||
@@ -20,13 +27,6 @@ describe('indent Python:', 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/python/' .. file, spec, opts)
|
||||
end)
|
||||
end
|
||||
|
||||
run('aligned_indent.py', { on_line = 1, text = 'arg3,', indent = 19 })
|
||||
run('basic_blocks.py', { on_line = 1, text = 'wait,', indent = 4 })
|
||||
run('basic_blocks.py', { on_line = 6, text = 'x += 1', indent = 4 })
|
||||
|
||||
Reference in New Issue
Block a user