From db97170e4e5f873f46f33564f0773a151f018c2f Mon Sep 17 00:00:00 2001 From: Jędrzej Boczar Date: Thu, 22 Apr 2021 21:23:24 +0200 Subject: tests/indent: move the run helper functions to top-level --- tests/indent/lua_spec.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/indent/lua_spec.lua') diff --git a/tests/indent/lua_spec.lua b/tests/indent/lua_spec.lua index 473f584c4..0a6a3b29a 100644 --- a/tests/indent/lua_spec.lua +++ b/tests/indent/lua_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/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 }) -- cgit v1.2.3-70-g09d2