diff options
| author | skewb1k <skewb1kunix@gmail.com> | 2025-12-09 21:59:06 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-09 13:59:06 -0500 |
| commit | bc0635a9fc9c15a2423d4eb35f627d127d00fa46 (patch) | |
| tree | 126aa84b6cc9d63f6269533dc6cf84bb07b69e31 /test/functional/lua/vim_spec.lua | |
| parent | 3b6e8e484edfb5f60990def1d90c4d046b59dc7e (diff) | |
| download | rneovim-bc0635a9fc9c15a2423d4eb35f627d127d00fa46.tar.gz rneovim-bc0635a9fc9c15a2423d4eb35f627d127d00fa46.tar.bz2 rneovim-bc0635a9fc9c15a2423d4eb35f627d127d00fa46.zip | |
fix(lua): vim.wait(math.huge) fails #36885
Problem:
`nlua_wait()` uses `luaL_checkinteger()` which doesn't support
`math.huge` since it's double type. On PUC Lua this fails with
'number has no integer representation' error and on LuaJIT this
overflows int.
Solution:
Use `luaL_checknumber()` and handle `math.huge`.
Diffstat (limited to 'test/functional/lua/vim_spec.lua')
| -rw-r--r-- | test/functional/lua/vim_spec.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua index 73b393f11a..6aef76f476 100644 --- a/test/functional/lua/vim_spec.lua +++ b/test/functional/lua/vim_spec.lua @@ -2451,7 +2451,8 @@ stack traceback: exec_lua([[ function _G.Wait() vim.rpcnotify(vim.g.channel, 'ready') - local _, interrupted = vim.wait(4000) + -- handles math.huge #36854 + local _, interrupted = vim.wait(math.huge) vim.rpcnotify(vim.g.channel, 'wait', interrupted) end ]]) @@ -2465,7 +2466,7 @@ stack traceback: exec_lua([[ function _G.Wait() vim.rpcnotify(vim.g.channel, 'ready') - local _, interrupted = vim.wait(4000, function() end) + local _, interrupted = vim.wait(math.huge, function() end) vim.rpcnotify(vim.g.channel, 'wait', interrupted) end ]]) |