diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-01-12 11:41:09 +0000 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2024-01-12 12:04:19 +0000 |
commit | 7a259d01aed52134a1675e47d9054ccad7ef7cbb (patch) | |
tree | ae3741677b97f408e589d55a3f7e5b863d1e1b58 /test/functional | |
parent | d33e1da9b7f7e886219cfdd20b9bbfaccdc43be9 (diff) | |
download | rneovim-7a259d01aed52134a1675e47d9054ccad7ef7cbb.tar.gz rneovim-7a259d01aed52134a1675e47d9054ccad7ef7cbb.tar.bz2 rneovim-7a259d01aed52134a1675e47d9054ccad7ef7cbb.zip |
test: remove helpers.sleep()
Diffstat (limited to 'test/functional')
26 files changed, 29 insertions, 30 deletions
diff --git a/test/functional/api/buffer_updates_spec.lua b/test/functional/api/buffer_updates_spec.lua index b0efcf0dab..af6404fe7f 100644 --- a/test/functional/api/buffer_updates_spec.lua +++ b/test/functional/api/buffer_updates_spec.lua @@ -6,7 +6,7 @@ local buffer, command, eval, nvim, next_msg = helpers.buffer, helpers.command, helpers.eval, helpers.nvim, helpers.next_msg local nvim_prog = helpers.nvim_prog local pcall_err = helpers.pcall_err -local sleep = helpers.sleep +local sleep = vim.uv.sleep local write_file = helpers.write_file local origlines = { diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua index 50c353d764..789ad28544 100644 --- a/test/functional/api/keymap_spec.lua +++ b/test/functional/api/keymap_spec.lua @@ -14,7 +14,7 @@ local source = helpers.source local pcall_err = helpers.pcall_err local shallowcopy = helpers.shallowcopy -local sleep = helpers.sleep +local sleep = vim.uv.sleep local sid_api_client = -9 local sid_lua = -8 diff --git a/test/functional/autocmd/cursorhold_spec.lua b/test/functional/autocmd/cursorhold_spec.lua index 535881b6cc..67ccf86ea4 100644 --- a/test/functional/autocmd/cursorhold_spec.lua +++ b/test/functional/autocmd/cursorhold_spec.lua @@ -5,7 +5,7 @@ local eq = helpers.eq local feed = helpers.feed local retry = helpers.retry local exec = helpers.source -local sleep = helpers.sleep +local sleep = vim.uv.sleep local meths = helpers.meths before_each(clear) diff --git a/test/functional/core/channels_spec.lua b/test/functional/core/channels_spec.lua index 0b58e8bc54..570dda0730 100644 --- a/test/functional/core/channels_spec.lua +++ b/test/functional/core/channels_spec.lua @@ -2,7 +2,7 @@ local helpers = require('test.functional.helpers')(after_each) local clear, eq, eval, next_msg, ok, source = helpers.clear, helpers.eq, helpers.eval, helpers.next_msg, helpers.ok, helpers.source local command, funcs, meths = helpers.command, helpers.funcs, helpers.meths -local sleep = helpers.sleep +local sleep = vim.uv.sleep local spawn, nvim_argv = helpers.spawn, helpers.nvim_argv local set_session = helpers.set_session local nvim_prog = helpers.nvim_prog diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua index 3aaa4383b4..6b821869ee 100644 --- a/test/functional/core/fileio_spec.lua +++ b/test/functional/core/fileio_spec.lua @@ -17,7 +17,7 @@ local rmdir = helpers.rmdir local matches = helpers.matches local meths = helpers.meths local mkdir = helpers.mkdir -local sleep = helpers.sleep +local sleep = vim.uv.sleep local read_file = helpers.read_file local trim = vim.trim local currentdir = helpers.funcs.getcwd @@ -295,7 +295,6 @@ describe('fileio', function() local future_time = cur_unix_time + 999999 -- Set the file's access/update time to be -- greater than the time at which it was created. - local uv = require('luv') uv.fs_utime('Xtest-overwrite-forced', future_time, future_time) -- use async feed_command because nvim basically hangs on the prompt feed_command('w') diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index 210007f027..e1baa6f48f 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -1177,7 +1177,7 @@ describe('jobs', function() -- Have to wait so that the SIGHUP can be processed by tty-test on time. -- Can't wait for the next message in case this test fails, if it fails -- there won't be any more messages, and the test would hang. - helpers.sleep(100) + vim.uv.sleep(100) local err = exc_exec('call jobpid(j)') eq('Vim(call):E900: Invalid channel id', err) diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index 7953a101e1..5d2da8f5e0 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -22,7 +22,7 @@ local nvim_set = helpers.nvim_set local read_file = helpers.read_file local retry = helpers.retry local rmdir = helpers.rmdir -local sleep = helpers.sleep +local sleep = vim.uv.sleep local startswith = vim.startswith local write_file = helpers.write_file local meths = helpers.meths diff --git a/test/functional/editor/K_spec.lua b/test/functional/editor/K_spec.lua index 92a00b28b6..1107de7984 100644 --- a/test/functional/editor/K_spec.lua +++ b/test/functional/editor/K_spec.lua @@ -36,7 +36,7 @@ describe('K', function() end) eq({ 'fnord' }, eval("readfile('" .. test_file .. "')")) -- Confirm that Neovim is still in terminal mode after K is pressed (#16692). - helpers.sleep(500) + vim.uv.sleep(500) eq('t', eval('mode()')) feed('<space>') -- Any key, not just <space>, can be used here to escape. eq('n', eval('mode()')) @@ -50,7 +50,7 @@ describe('K', function() -- Confirm that an arbitrary keypress doesn't escape (i.e., the process is -- still running). If the process were no longer running, an arbitrary -- keypress would escape. - helpers.sleep(500) + vim.uv.sleep(500) feed('<space>') eq('t', eval('mode()')) -- Confirm that <esc> kills the buffer for the running command. diff --git a/test/functional/editor/completion_spec.lua b/test/functional/editor/completion_spec.lua index fbb63fdba6..c13222bd7a 100644 --- a/test/functional/editor/completion_spec.lua +++ b/test/functional/editor/completion_spec.lua @@ -691,7 +691,7 @@ describe('completion', function() ]]) -- Works for unindenting too. feed('ounin<C-X><C-N>') - helpers.poke_eventloop() + poke_eventloop() feed('<BS>d') screen:expect([[ inc uninc indent unindent | @@ -1067,7 +1067,7 @@ describe('completion', function() {3:-- }{4:match 1 of 3} | ]]) command([[call timer_start(100, { -> execute('stopinsert') })]]) - helpers.sleep(200) + vim.uv.sleep(200) feed('k') -- cursor should move up in Normal mode screen:expect([[ hello | diff --git a/test/functional/editor/ctrl_c_spec.lua b/test/functional/editor/ctrl_c_spec.lua index 0321a21b35..e6a6ea808a 100644 --- a/test/functional/editor/ctrl_c_spec.lua +++ b/test/functional/editor/ctrl_c_spec.lua @@ -3,7 +3,7 @@ local Screen = require('test.functional.ui.screen') local clear, feed, source = helpers.clear, helpers.feed, helpers.source local command = helpers.command local poke_eventloop = helpers.poke_eventloop -local sleep = helpers.sleep +local sleep = vim.uv.sleep describe('CTRL-C (mapped)', function() local screen diff --git a/test/functional/ex_cmds/mksession_spec.lua b/test/functional/ex_cmds/mksession_spec.lua index 1885963bbc..cc3a81f7dd 100644 --- a/test/functional/ex_cmds/mksession_spec.lua +++ b/test/functional/ex_cmds/mksession_spec.lua @@ -10,7 +10,7 @@ local funcs = helpers.funcs local matches = helpers.matches local pesc = vim.pesc local rmdir = helpers.rmdir -local sleep = helpers.sleep +local sleep = vim.uv.sleep local meths = helpers.meths local skip = helpers.skip local is_os = helpers.is_os diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index e4342d1dc0..763b3c8663 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -12,7 +12,7 @@ local dedent = global_helpers.dedent local eq = global_helpers.eq local is_os = global_helpers.is_os local ok = global_helpers.ok -local sleep = global_helpers.sleep +local sleep = uv.sleep local fail = global_helpers.fail local module = {} diff --git a/test/functional/legacy/edit_spec.lua b/test/functional/legacy/edit_spec.lua index 59e9805a91..0762e5e671 100644 --- a/test/functional/legacy/edit_spec.lua +++ b/test/functional/legacy/edit_spec.lua @@ -4,7 +4,7 @@ local clear = helpers.clear local command = helpers.command local expect = helpers.expect local feed = helpers.feed -local sleep = helpers.sleep +local sleep = vim.uv.sleep before_each(clear) diff --git a/test/functional/legacy/mapping_spec.lua b/test/functional/legacy/mapping_spec.lua index 28efb912f8..46c9a869ac 100644 --- a/test/functional/legacy/mapping_spec.lua +++ b/test/functional/legacy/mapping_spec.lua @@ -4,7 +4,7 @@ local helpers = require('test.functional.helpers')(after_each) local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local expect, poke_eventloop = helpers.expect, helpers.poke_eventloop local command, eq, eval, meths = helpers.command, helpers.eq, helpers.eval, helpers.meths -local sleep = helpers.sleep +local sleep = vim.uv.sleep describe('mapping', function() before_each(clear) diff --git a/test/functional/lua/highlight_spec.lua b/test/functional/lua/highlight_spec.lua index 8e499f1e79..f304bec411 100644 --- a/test/functional/lua/highlight_spec.lua +++ b/test/functional/lua/highlight_spec.lua @@ -16,7 +16,7 @@ describe('vim.highlight.on_yank', function() vim.highlight.on_yank({timeout = 10, on_macro = true, event = {operator = "y", regtype = "v"}}) vim.cmd('bwipeout!') ]]) - helpers.sleep(10) + vim.uv.sleep(10) helpers.feed('<cr>') -- avoid hang if error message exists eq('', eval('v:errmsg')) end) diff --git a/test/functional/lua/loader_spec.lua b/test/functional/lua/loader_spec.lua index 92dd2296cb..cdb561330a 100644 --- a/test/functional/lua/loader_spec.lua +++ b/test/functional/lua/loader_spec.lua @@ -30,7 +30,7 @@ describe('vim.loader', function() ) -- fs latency - helpers.sleep(10) + vim.uv.sleep(10) eq( 2, diff --git a/test/functional/lua/loop_spec.lua b/test/functional/lua/loop_spec.lua index e46dbe7455..38d6f1c24f 100644 --- a/test/functional/lua/loop_spec.lua +++ b/test/functional/lua/loop_spec.lua @@ -4,7 +4,7 @@ local Screen = require('test.functional.ui.screen') local funcs = helpers.funcs local meths = helpers.meths local clear = helpers.clear -local sleep = helpers.sleep +local sleep = vim.uv.sleep local feed = helpers.feed local eq = helpers.eq local eval = helpers.eval diff --git a/test/functional/lua/snippet_spec.lua b/test/functional/lua/snippet_spec.lua index defd13429e..bf73e6c6fd 100644 --- a/test/functional/lua/snippet_spec.lua +++ b/test/functional/lua/snippet_spec.lua @@ -7,7 +7,7 @@ local exec_lua = helpers.exec_lua local feed = helpers.feed local matches = helpers.matches local pcall_err = helpers.pcall_err -local sleep = helpers.sleep +local sleep = vim.uv.sleep describe('vim.snippet', function() before_each(function() diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 497d7668e8..48a38864d6 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -15,7 +15,7 @@ local command = helpers.command local exc_exec = helpers.exc_exec local matches = helpers.matches local exec_lua = helpers.exec_lua -local sleep = helpers.sleep +local sleep = vim.uv.sleep local funcs = helpers.funcs local is_os = helpers.is_os local skip = helpers.skip diff --git a/test/functional/terminal/window_split_tab_spec.lua b/test/functional/terminal/window_split_tab_spec.lua index 1fb759b571..846188685b 100644 --- a/test/functional/terminal/window_split_tab_spec.lua +++ b/test/functional/terminal/window_split_tab_spec.lua @@ -8,7 +8,7 @@ local command = helpers.command local eq = helpers.eq local eval = helpers.eval local meths = helpers.meths -local sleep = helpers.sleep +local sleep = vim.uv.sleep local retry = helpers.retry local is_os = helpers.is_os diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index d6a0205b7e..6ff2a12ded 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -1706,7 +1706,7 @@ describe('extmark decorations', function() ]] for _ = 1, 3 do - helpers.sleep(10) + vim.uv.sleep(10) feed 'j' end diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua index 6b64928622..60bdf97b79 100644 --- a/test/functional/ui/inccommand_spec.lua +++ b/test/functional/ui/inccommand_spec.lua @@ -15,7 +15,7 @@ local retry = helpers.retry local source = helpers.source local poke_eventloop = helpers.poke_eventloop local nvim = helpers.nvim -local sleep = helpers.sleep +local sleep = vim.uv.sleep local testprg = helpers.testprg local assert_alive = helpers.assert_alive diff --git a/test/functional/ui/input_spec.lua b/test/functional/ui/input_spec.lua index 92bc6a7f76..7cb8d4622d 100644 --- a/test/functional/ui/input_spec.lua +++ b/test/functional/ui/input_spec.lua @@ -154,7 +154,7 @@ describe('input split utf sequences', function() it('ok', function() local str = '►' feed('i' .. str:sub(1, 1)) - helpers.sleep(10) + vim.uv.sleep(10) feed(str:sub(2, 3)) expect('►') end) @@ -163,7 +163,7 @@ describe('input split utf sequences', function() command('inoremap ► E296BA') local str = '►' feed('i' .. str:sub(1, 1)) - helpers.sleep(10) + vim.uv.sleep(10) feed(str:sub(2, 3)) expect('E296BA') end) diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index da0a68edcb..94b4ead434 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -1650,7 +1650,7 @@ describe('builtin popupmenu', function() -- test nvim_complete_set_info feed('<C-N><C-N>') - helpers.sleep(10) + vim.uv.sleep(10) if multigrid then screen:expect { grid = [[ diff --git a/test/functional/ui/statusline_spec.lua b/test/functional/ui/statusline_spec.lua index 873f529097..7e6d336ff9 100644 --- a/test/functional/ui/statusline_spec.lua +++ b/test/functional/ui/statusline_spec.lua @@ -10,7 +10,7 @@ local meths = helpers.meths local exec = helpers.exec local exec_lua = helpers.exec_lua local eval = helpers.eval -local sleep = helpers.sleep +local sleep = vim.uv.sleep local mousemodels = { 'extend', 'popup', 'popup_setpos' } diff --git a/test/functional/vimscript/eval_spec.lua b/test/functional/vimscript/eval_spec.lua index a562f6f888..da8be7e90c 100644 --- a/test/functional/vimscript/eval_spec.lua +++ b/test/functional/vimscript/eval_spec.lua @@ -23,7 +23,7 @@ local eval = helpers.eval local command = helpers.command local write_file = helpers.write_file local meths = helpers.meths -local sleep = helpers.sleep +local sleep = vim.uv.sleep local matches = helpers.matches local pcall_err = helpers.pcall_err local assert_alive = helpers.assert_alive |