aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-06 08:59:50 +0800
committerGitHub <noreply@github.com>2024-04-06 08:59:50 +0800
commit5581a90e20777a2493ca9835b11a67435287d64e (patch)
tree3a881ec6464e540ecae18e7092fa21438018b92b
parent08ae0c840b31b1ef9ed56c0f9d2f96585b474538 (diff)
downloadrneovim-5581a90e20777a2493ca9835b11a67435287d64e.tar.gz
rneovim-5581a90e20777a2493ca9835b11a67435287d64e.tar.bz2
rneovim-5581a90e20777a2493ca9835b11a67435287d64e.zip
test: reduce sleep for file timestamp change (#28196)
Now that Nvim always supports nanotime, sleeping for some milliseconds is enough.
-rw-r--r--test/functional/api/keymap_spec.lua2
-rw-r--r--test/functional/shada/marks_spec.lua12
-rw-r--r--test/functional/ui/input_spec.lua4
3 files changed, 9 insertions, 9 deletions
diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua
index 0decd710e9..4380e76486 100644
--- a/test/functional/api/keymap_spec.lua
+++ b/test/functional/api/keymap_spec.lua
@@ -738,7 +738,7 @@ describe('nvim_set_keymap, nvim_del_keymap', function()
end
end
- it('can set mappings containing literal keycodes', function()
+ it('can set mappings containing C0 control codes', function()
api.nvim_set_keymap('n', '\n\r\n', 'rhs', {})
local expected = generate_mapargs('n', '<NL><CR><NL>', 'rhs')
eq(expected, get_mapargs('n', '<NL><CR><NL>'))
diff --git a/test/functional/shada/marks_spec.lua b/test/functional/shada/marks_spec.lua
index 3f29a02506..6eb1df38a3 100644
--- a/test/functional/shada/marks_spec.lua
+++ b/test/functional/shada/marks_spec.lua
@@ -163,17 +163,17 @@ describe('ShaDa support code', function()
eq({ 2, 0 }, api.nvim_win_get_cursor(0))
end)
- it('is able to dump and restore jump list with different times (slow!)', function()
+ it('is able to dump and restore jump list with different times', function()
nvim_command('edit ' .. testfilename_2)
- nvim_command('sleep 2')
+ nvim_command('sleep 10m')
nvim_command('normal! G')
- nvim_command('sleep 2')
+ nvim_command('sleep 10m')
nvim_command('normal! gg')
- nvim_command('sleep 2')
+ nvim_command('sleep 10m')
nvim_command('edit ' .. testfilename)
- nvim_command('sleep 2')
+ nvim_command('sleep 10m')
nvim_command('normal! G')
- nvim_command('sleep 2')
+ nvim_command('sleep 10m')
nvim_command('normal! gg')
expect_exit(nvim_command, 'qall')
reset()
diff --git a/test/functional/ui/input_spec.lua b/test/functional/ui/input_spec.lua
index 348be7af6a..9c18127875 100644
--- a/test/functional/ui/input_spec.lua
+++ b/test/functional/ui/input_spec.lua
@@ -336,8 +336,8 @@ describe('input non-printable chars', function()
"Xtest-overwrite" [noeol] 1L, 6B |
]])
- -- The timestamp is in second resolution, wait two seconds to be sure.
- screen:sleep(2000)
+ -- Wait for some time so that the timestamp changes.
+ vim.uv.sleep(10)
write_file('Xtest-overwrite', [[smurf]])
feed_command('w')
screen:expect([[