aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/loop_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
commit931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch)
treed8c1843a95da5ea0bb4acc09f7e37843d9995c86 /test/functional/lua/loop_spec.lua
parent142d9041391780ac15b89886a54015fdc5c73995 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-userreg.tar.gz
rneovim-userreg.tar.bz2
rneovim-userreg.zip
Merge remote-tracking branch 'upstream/master' into userreguserreg
Diffstat (limited to 'test/functional/lua/loop_spec.lua')
-rw-r--r--test/functional/lua/loop_spec.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/functional/lua/loop_spec.lua b/test/functional/lua/loop_spec.lua
index 7f3787d7bf..c0924fa0c0 100644
--- a/test/functional/lua/loop_spec.lua
+++ b/test/functional/lua/loop_spec.lua
@@ -14,24 +14,24 @@ local retry = helpers.retry
before_each(clear)
-describe('vim.loop', function()
+describe('vim.uv', function()
it('version', function()
- assert(funcs.luaeval('vim.loop.version()')>=72961, "libuv version too old")
- matches("(%d+)%.(%d+)%.(%d+)", funcs.luaeval('vim.loop.version_string()'))
+ assert(funcs.luaeval('vim.uv.version()')>=72961, "libuv version too old")
+ matches("(%d+)%.(%d+)%.(%d+)", funcs.luaeval('vim.uv.version_string()'))
end)
it('timer', function()
exec_lua('vim.api.nvim_set_var("coroutine_cnt", 0)', {})
local code=[[
- local loop = vim.loop
+ local uv = vim.uv
local touch = 0
local function wait(ms)
local this = coroutine.running()
assert(this)
- local timer = loop.new_timer()
+ local timer = uv.new_timer()
timer:start(ms, 0, vim.schedule_wrap(function ()
timer:close()
touch = touch + 1
@@ -73,7 +73,7 @@ describe('vim.loop', function()
-- deferred API functions are disabled, as their safety can't be guaranteed
exec_lua([[
- local timer = vim.loop.new_timer()
+ local timer = vim.uv.new_timer()
timer:start(20, 0, function ()
_G.is_fast = vim.in_fast_event()
timer:close()
@@ -101,7 +101,7 @@ describe('vim.loop', function()
-- callbacks can be scheduled to be executed in the main event loop
-- where the entire API is available
exec_lua([[
- local timer = vim.loop.new_timer()
+ local timer = vim.uv.new_timer()
timer:start(20, 0, vim.schedule_wrap(function ()
_G.is_fast = vim.in_fast_event()
timer:close()
@@ -127,7 +127,7 @@ describe('vim.loop', function()
-- fast (not deferred) API functions are allowed to be called directly
exec_lua([[
- local timer = vim.loop.new_timer()
+ local timer = vim.uv.new_timer()
timer:start(20, 0, function ()
timer:close()
-- input is queued for processing after the callback returns
@@ -151,6 +151,6 @@ describe('vim.loop', function()
end)
it("is equal to require('luv')", function()
- eq(true, exec_lua("return vim.loop == require('luv')"))
+ eq(true, exec_lua("return vim.uv == require('luv')"))
end)
end)