diff options
Diffstat (limited to 'test/functional/lua/overrides_spec.lua')
-rw-r--r-- | test/functional/lua/overrides_spec.lua | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/test/functional/lua/overrides_spec.lua b/test/functional/lua/overrides_spec.lua index 849978f080..33a2813200 100644 --- a/test/functional/lua/overrides_spec.lua +++ b/test/functional/lua/overrides_spec.lua @@ -134,14 +134,12 @@ describe('print', function() eq('abc def', exec_capture('lua print("abc", "", "def")')) end) it('defers printing in luv event handlers', function() - exec_lua( - [[ - local cmd = ... + exec_lua(function(cmd) function test() local timer = vim.uv.new_timer() local done = false timer:start(10, 0, function() - print("very fast") + print('very fast') timer:close() done = true end) @@ -149,14 +147,12 @@ describe('print', function() -- loop until we know for sure the callback has been executed while not done do os.execute(cmd) - vim.uv.run("nowait") -- fake os_breakcheck() + vim.uv.run('nowait') -- fake os_breakcheck() end - print("very slow") - vim.api.nvim_command("sleep 1m") -- force deferred event processing + print('very slow') + vim.api.nvim_command('sleep 1m') -- force deferred event processing end - ]], - (is_os('win') and 'timeout 1') or 'sleep 0.1' - ) + end, (is_os('win') and 'timeout 1') or 'sleep 0.1') eq('very slow\nvery fast', exec_capture('lua test()')) end) |