aboutsummaryrefslogtreecommitdiffstats
path: root/tests/indent/python_spec.lua
diff options
context:
space:
mode:
authorJędrzej Boczar <yendreij@gmail.com>2021-04-22 21:23:24 +0200
committerKiyan <yazdani.kiyan@protonmail.com>2021-04-23 21:21:38 +0200
commitdb97170e4e5f873f46f33564f0773a151f018c2f (patch)
treebc749ebb68ab3b52440c282ea3b9b5b1a9df5f7c /tests/indent/python_spec.lua
parentmove all tests to top-level tests/ directory (diff)
downloadnvim-treesitter-db97170e4e5f873f46f33564f0773a151f018c2f.tar
nvim-treesitter-db97170e4e5f873f46f33564f0773a151f018c2f.tar.gz
nvim-treesitter-db97170e4e5f873f46f33564f0773a151f018c2f.tar.bz2
nvim-treesitter-db97170e4e5f873f46f33564f0773a151f018c2f.tar.lz
nvim-treesitter-db97170e4e5f873f46f33564f0773a151f018c2f.tar.xz
nvim-treesitter-db97170e4e5f873f46f33564f0773a151f018c2f.tar.zst
nvim-treesitter-db97170e4e5f873f46f33564f0773a151f018c2f.zip
tests/indent: move the run helper functions to top-level
Diffstat (limited to 'tests/indent/python_spec.lua')
-rw-r--r--tests/indent/python_spec.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/indent/python_spec.lua b/tests/indent/python_spec.lua
index 7a058af55..85c3bc3bf 100644
--- a/tests/indent/python_spec.lua
+++ b/tests/indent/python_spec.lua
@@ -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 })