aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-01-12 12:03:25 +0000
committerLewis Russell <lewis6991@gmail.com>2024-01-12 12:04:20 +0000
commit284e0ad26dd9de90c3a813dd1b357a425eca6bad (patch)
tree55b60f82154a6aadbd3c53e6441e0b2c590f11f6 /test/functional
parent56a2ec5c79d49421758319f1a8822cf30f1f8a5e (diff)
downloadrneovim-284e0ad26dd9de90c3a813dd1b357a425eca6bad.tar.gz
rneovim-284e0ad26dd9de90c3a813dd1b357a425eca6bad.tar.bz2
rneovim-284e0ad26dd9de90c3a813dd1b357a425eca6bad.zip
test: use vim.mpack and vim.uv directly
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/api/version_spec.lua3
-rw-r--r--test/functional/autocmd/dirchanged_spec.lua3
-rw-r--r--test/functional/autocmd/focus_spec.lua3
-rw-r--r--test/functional/autocmd/termxx_spec.lua18
-rw-r--r--test/functional/core/main_spec.lua12
-rw-r--r--test/functional/ex_cmds/cd_spec.lua3
-rw-r--r--test/functional/ex_cmds/file_spec.lua3
-rw-r--r--test/functional/ex_cmds/profile_spec.lua10
-rw-r--r--test/functional/ex_cmds/write_spec.lua3
-rw-r--r--test/functional/ex_cmds/wviminfo_spec.lua7
-rw-r--r--test/functional/legacy/011_autocommands_spec.lua5
-rw-r--r--test/functional/legacy/012_directory_spec.lua7
-rw-r--r--test/functional/legacy/074_global_var_in_viminfo_spec.lua3
-rw-r--r--test/functional/lua/buffer_updates_spec.lua3
-rw-r--r--test/functional/lua/fs_spec.lua3
-rw-r--r--test/functional/lua/loop_spec.lua4
-rw-r--r--test/functional/options/autochdir_spec.lua3
-rw-r--r--test/functional/plugin/shada_spec.lua4
-rw-r--r--test/functional/shada/helpers.lua4
-rw-r--r--test/functional/shada/shada_spec.lua16
-rw-r--r--test/functional/ui/embed_spec.lua2
-rw-r--r--test/functional/vimscript/buf_functions_spec.lua6
-rw-r--r--test/functional/vimscript/glob_spec.lua3
-rw-r--r--test/functional/vimscript/has_spec.lua3
-rw-r--r--test/functional/vimscript/writefile_spec.lua5
25 files changed, 55 insertions, 81 deletions
diff --git a/test/functional/api/version_spec.lua b/test/functional/api/version_spec.lua
index 76cdb9cbca..41f8fccab9 100644
--- a/test/functional/api/version_spec.lua
+++ b/test/functional/api/version_spec.lua
@@ -1,5 +1,4 @@
local helpers = require('test.functional.helpers')(after_each)
-local mpack = require('mpack')
local clear, funcs, eq = helpers.clear, helpers.funcs, helpers.eq
local call = helpers.call
local meths = helpers.meths
@@ -12,7 +11,7 @@ local function read_mpack_file(fname)
local data = fd:read('*a')
fd:close()
- local unpack = mpack.Unpacker()
+ local unpack = vim.mpack.Unpacker()
return unpack(data)
end
diff --git a/test/functional/autocmd/dirchanged_spec.lua b/test/functional/autocmd/dirchanged_spec.lua
index 208bd0f0e9..7ad529891f 100644
--- a/test/functional/autocmd/dirchanged_spec.lua
+++ b/test/functional/autocmd/dirchanged_spec.lua
@@ -1,4 +1,3 @@
-local luv = require('luv')
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
@@ -9,7 +8,7 @@ local request = helpers.request
local is_os = helpers.is_os
describe('autocmd DirChanged and DirChangedPre', function()
- local curdir = string.gsub(luv.cwd(), '\\', '/')
+ local curdir = vim.uv.cwd():gsub('\\', '/')
local dirs = {
curdir .. '/Xtest-functional-autocmd-dirchanged.dir1',
curdir .. '/Xtest-functional-autocmd-dirchanged.dir2',
diff --git a/test/functional/autocmd/focus_spec.lua b/test/functional/autocmd/focus_spec.lua
index cd9f2c96c1..b9bab206fc 100644
--- a/test/functional/autocmd/focus_spec.lua
+++ b/test/functional/autocmd/focus_spec.lua
@@ -1,6 +1,5 @@
local helpers = require('test.functional.helpers')(after_each)
local thelpers = require('test.functional.terminal.helpers')
-local luv = require('luv')
local clear = helpers.clear
local feed_command = helpers.feed_command
local feed_data = thelpers.feed_data
@@ -42,7 +41,7 @@ describe('autoread TUI FocusGained/FocusLost', function()
helpers.write_file(path, '')
local atime = os.time() - 10
- luv.fs_utime(path, atime, atime)
+ vim.uv.fs_utime(path, atime, atime)
screen:expect {
grid = [[
diff --git a/test/functional/autocmd/termxx_spec.lua b/test/functional/autocmd/termxx_spec.lua
index 71ae7dfe9b..dd79de4c37 100644
--- a/test/functional/autocmd/termxx_spec.lua
+++ b/test/functional/autocmd/termxx_spec.lua
@@ -1,4 +1,4 @@
-local luv = require('luv')
+local uv = vim.uv
local helpers = require('test.functional.helpers')(after_each)
local thelpers = require('test.functional.terminal.helpers')
@@ -78,14 +78,14 @@ describe('autocmd TermClose', function()
eq(1, eval('get(g:, "test_job_started", 0)'))
end)
- luv.update_time()
- local start = luv.now()
+ uv.update_time()
+ local start = uv.now()
command('call jobstop(g:test_job)')
retry(nil, nil, function()
eq(1, eval('get(g:, "test_job_exited", 0)'))
end)
- luv.update_time()
- local duration = luv.now() - start
+ uv.update_time()
+ local duration = uv.now() - start
-- Nvim begins SIGTERM after KILL_TIMEOUT_MS.
ok(duration >= 2000)
ok(duration <= 4000) -- Epsilon for slow CI
@@ -105,14 +105,14 @@ describe('autocmd TermClose', function()
eq(1, eval('get(g:, "test_job_started", 0)'))
end)
- luv.update_time()
- local start = luv.now()
+ uv.update_time()
+ local start = uv.now()
command('call jobstop(g:test_job)')
retry(nil, nil, function()
eq(1, eval('get(g:, "test_job_exited", 0)'))
end)
- luv.update_time()
- local duration = luv.now() - start
+ uv.update_time()
+ local duration = uv.now() - start
-- Nvim begins SIGKILL after (2 * KILL_TIMEOUT_MS).
ok(duration >= 4000)
ok(duration <= 7000) -- Epsilon for slow CI
diff --git a/test/functional/core/main_spec.lua b/test/functional/core/main_spec.lua
index 4a9943be20..47b96535b3 100644
--- a/test/functional/core/main_spec.lua
+++ b/test/functional/core/main_spec.lua
@@ -1,4 +1,4 @@
-local luv = require('luv')
+local uv = vim.uv
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
@@ -32,7 +32,7 @@ describe('command-line option', function()
end)
it('treats - as stdin', function()
- eq(nil, luv.fs_stat(fname))
+ eq(nil, uv.fs_stat(fname))
funcs.system({
nvim_prog_abs(),
'-u',
@@ -47,12 +47,12 @@ describe('command-line option', function()
fname,
}, { ':call setline(1, "42")', ':wqall!', '' })
eq(0, eval('v:shell_error'))
- local attrs = luv.fs_stat(fname)
+ local attrs = uv.fs_stat(fname)
eq(#'42\n', attrs.size)
end)
it('does not expand $VAR', function()
- eq(nil, luv.fs_stat(fname))
+ eq(nil, uv.fs_stat(fname))
eq(true, not not dollar_fname:find('%$%w+'))
write_file(dollar_fname, ':call setline(1, "100500")\n:wqall!\n')
funcs.system({
@@ -69,7 +69,7 @@ describe('command-line option', function()
fname,
})
eq(0, eval('v:shell_error'))
- local attrs = luv.fs_stat(fname)
+ local attrs = uv.fs_stat(fname)
eq(#'100500\n', attrs.size)
end)
@@ -170,7 +170,7 @@ describe('command-line option', function()
})
)
eq(2, eval('v:shell_error'))
- eq(nil, luv.fs_stat(fname_2))
+ eq(nil, uv.fs_stat(fname_2))
end)
end)
diff --git a/test/functional/ex_cmds/cd_spec.lua b/test/functional/ex_cmds/cd_spec.lua
index a6ee5afe49..1815c672dc 100644
--- a/test/functional/ex_cmds/cd_spec.lua
+++ b/test/functional/ex_cmds/cd_spec.lua
@@ -1,6 +1,5 @@
-- Specs for :cd, :tcd, :lcd and getcwd()
-local luv = require('luv')
local helpers = require('test.functional.helpers')(after_each)
local eq = helpers.eq
@@ -56,7 +55,7 @@ for _, cmd in ipairs { 'cd', 'chdir' } do
after_each(function()
for _, d in pairs(directories) do
- luv.fs_rmdir(d)
+ vim.uv.fs_rmdir(d)
end
end)
diff --git a/test/functional/ex_cmds/file_spec.lua b/test/functional/ex_cmds/file_spec.lua
index bfcfccda7b..ce55b61d53 100644
--- a/test/functional/ex_cmds/file_spec.lua
+++ b/test/functional/ex_cmds/file_spec.lua
@@ -1,5 +1,4 @@
local helpers = require('test.functional.helpers')(after_each)
-local luv = require('luv')
local clear = helpers.clear
local command = helpers.command
local eq = helpers.eq
@@ -8,7 +7,7 @@ local rmdir = helpers.rmdir
local mkdir = helpers.mkdir
describe(':file', function()
- local swapdir = luv.cwd() .. '/Xtest-file_spec'
+ local swapdir = vim.uv.cwd() .. '/Xtest-file_spec'
before_each(function()
clear()
rmdir(swapdir)
diff --git a/test/functional/ex_cmds/profile_spec.lua b/test/functional/ex_cmds/profile_spec.lua
index fb594c70e6..f85dcc60ff 100644
--- a/test/functional/ex_cmds/profile_spec.lua
+++ b/test/functional/ex_cmds/profile_spec.lua
@@ -1,5 +1,5 @@
require('os')
-local luv = require('luv')
+local uv = vim.uv
local helpers = require('test.functional.helpers')(after_each)
local eval = helpers.eval
@@ -12,16 +12,16 @@ local read_file = helpers.read_file
-- tmpname() also creates the file on POSIX systems. Remove it again.
-- We just need the name, ignoring any race conditions.
-if luv.fs_stat(tempfile).uid then
+if uv.fs_stat(tempfile).uid then
os.remove(tempfile)
end
local function assert_file_exists(filepath)
- neq(nil, luv.fs_stat(filepath).uid)
+ neq(nil, uv.fs_stat(filepath).uid)
end
local function assert_file_exists_not(filepath)
- eq(nil, luv.fs_stat(filepath))
+ eq(nil, uv.fs_stat(filepath))
end
describe(':profile', function()
@@ -29,7 +29,7 @@ describe(':profile', function()
after_each(function()
helpers.expect_exit(command, 'qall!')
- if luv.fs_stat(tempfile).uid ~= nil then
+ if uv.fs_stat(tempfile).uid ~= nil then
os.remove(tempfile)
end
end)
diff --git a/test/functional/ex_cmds/write_spec.lua b/test/functional/ex_cmds/write_spec.lua
index e1cb33f060..a363578ce6 100644
--- a/test/functional/ex_cmds/write_spec.lua
+++ b/test/functional/ex_cmds/write_spec.lua
@@ -1,5 +1,4 @@
local helpers = require('test.functional.helpers')(after_each)
-local luv = require('luv')
local eq, eval, clear, write_file, source, insert =
helpers.eq, helpers.eval, helpers.clear, helpers.write_file, helpers.source, helpers.insert
local pcall_err = helpers.pcall_err
@@ -159,7 +158,7 @@ describe(':write', function()
end
write_file(fname_bak, 'TTYX')
skip(is_os('win'), [[FIXME: exc_exec('write!') outputs 0 in Windows]])
- luv.fs_symlink(fname_bak .. ('/xxxxx'):rep(20), fname)
+ vim.uv.fs_symlink(fname_bak .. ('/xxxxx'):rep(20), fname)
eq("Vim(write):E166: Can't open linked file for writing", pcall_err(command, 'write!'))
end)
end)
diff --git a/test/functional/ex_cmds/wviminfo_spec.lua b/test/functional/ex_cmds/wviminfo_spec.lua
index 5e840c2ab5..23ae1440e6 100644
--- a/test/functional/ex_cmds/wviminfo_spec.lua
+++ b/test/functional/ex_cmds/wviminfo_spec.lua
@@ -1,5 +1,4 @@
local helpers = require('test.functional.helpers')(after_each)
-local luv = require('luv')
local clear = helpers.clear
local command, eq, neq, write_file = helpers.command, helpers.eq, helpers.neq, helpers.write_file
local read_file = helpers.read_file
@@ -26,10 +25,10 @@ describe(':wshada', function()
it('creates a shada file', function()
-- file should _not_ exist
- eq(nil, luv.fs_stat(shada_file))
+ eq(nil, vim.uv.fs_stat(shada_file))
command('wsh! ' .. shada_file)
-- file _should_ exist
- neq(nil, luv.fs_stat(shada_file))
+ neq(nil, vim.uv.fs_stat(shada_file))
end)
it('overwrites existing files', function()
@@ -40,7 +39,7 @@ describe(':wshada', function()
-- sanity check
eq(text, read_file(shada_file))
- neq(nil, luv.fs_stat(shada_file))
+ neq(nil, vim.uv.fs_stat(shada_file))
command('wsh! ' .. shada_file)
diff --git a/test/functional/legacy/011_autocommands_spec.lua b/test/functional/legacy/011_autocommands_spec.lua
index 0cce6bcd11..eba878b99a 100644
--- a/test/functional/legacy/011_autocommands_spec.lua
+++ b/test/functional/legacy/011_autocommands_spec.lua
@@ -13,7 +13,6 @@
-- being modified outside of Vim (noticed on Solaris).
local helpers = require('test.functional.helpers')(after_each)
-local luv = require('luv')
local clear, feed_command, expect, eq, neq, dedent, write_file, feed =
helpers.clear,
helpers.feed_command,
@@ -37,8 +36,8 @@ local function prepare_gz_file(name, text)
-- Compress the file with gzip.
command([[call system(['gzip', '--force', ']] .. name .. [['])]])
-- This should create the .gz file and delete the original.
- neq(nil, luv.fs_stat(name .. '.gz'))
- eq(nil, luv.fs_stat(name))
+ neq(nil, vim.uv.fs_stat(name .. '.gz'))
+ eq(nil, vim.uv.fs_stat(name))
end
describe('file reading, writing and bufnew and filter autocommands', function()
diff --git a/test/functional/legacy/012_directory_spec.lua b/test/functional/legacy/012_directory_spec.lua
index f78648a328..8f0abc471a 100644
--- a/test/functional/legacy/012_directory_spec.lua
+++ b/test/functional/legacy/012_directory_spec.lua
@@ -4,7 +4,6 @@
-- - "dir", in directory relative to current dir
local helpers = require('test.functional.helpers')(after_each)
-local luv = require('luv')
local eq = helpers.eq
local neq = helpers.neq
@@ -62,21 +61,21 @@ describe("'directory' option", function()
meths.set_option_value('directory', '.', {})
-- sanity check: files should not exist yet.
- eq(nil, luv.fs_stat('.Xtest1.swp'))
+ eq(nil, vim.uv.fs_stat('.Xtest1.swp'))
command('edit! Xtest1')
poke_eventloop()
eq('Xtest1', funcs.buffer_name('%'))
-- Verify that the swapfile exists. In the legacy test this was done by
-- reading the output from :!ls.
- neq(nil, luv.fs_stat('.Xtest1.swp'))
+ neq(nil, vim.uv.fs_stat('.Xtest1.swp'))
meths.set_option_value('directory', './Xtest2,.', {})
command('edit Xtest1')
poke_eventloop()
-- swapfile should no longer exist in CWD.
- eq(nil, luv.fs_stat('.Xtest1.swp'))
+ eq(nil, vim.uv.fs_stat('.Xtest1.swp'))
eq({ 'Xtest1.swp', 'Xtest3' }, ls_dir_sorted('Xtest2'))
diff --git a/test/functional/legacy/074_global_var_in_viminfo_spec.lua b/test/functional/legacy/074_global_var_in_viminfo_spec.lua
index 3a4ab31bea..0a9ad330c2 100644
--- a/test/functional/legacy/074_global_var_in_viminfo_spec.lua
+++ b/test/functional/legacy/074_global_var_in_viminfo_spec.lua
@@ -1,7 +1,6 @@
-- Tests for storing global variables in the .shada file
local helpers = require('test.functional.helpers')(after_each)
-local luv = require('luv')
local clear, command, eq, neq, eval, poke_eventloop =
helpers.clear, helpers.command, helpers.eq, helpers.neq, helpers.eval, helpers.poke_eventloop
@@ -134,7 +133,7 @@ describe('storing global variables in ShaDa files', function()
poke_eventloop()
-- Assert that the shada file exists.
- neq(nil, luv.fs_stat(tempname))
+ neq(nil, vim.uv.fs_stat(tempname))
command('unlet MY_GLOBAL_DICT')
command('unlet MY_GLOBAL_LIST')
-- Assert that the variables where deleted.
diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua
index 073ac40ef1..79e221de4c 100644
--- a/test/functional/lua/buffer_updates_spec.lua
+++ b/test/functional/lua/buffer_updates_spec.lua
@@ -1,6 +1,5 @@
-- Test suite for testing interactions with API bindings
local helpers = require('test.functional.helpers')(after_each)
-local luv = require('luv')
local command = helpers.command
local meths = helpers.meths
@@ -777,7 +776,7 @@ describe('lua: nvim_buf_attach on_bytes', function()
old line 2]]
)
local atime = os.time() - 10
- luv.fs_utime('Xtest-reload', atime, atime)
+ vim.uv.fs_utime('Xtest-reload', atime, atime)
command 'e Xtest-reload'
command 'set autoread'
diff --git a/test/functional/lua/fs_spec.lua b/test/functional/lua/fs_spec.lua
index c212f4ad9a..66ba0f71f2 100644
--- a/test/functional/lua/fs_spec.lua
+++ b/test/functional/lua/fs_spec.lua
@@ -1,5 +1,4 @@
local helpers = require('test.functional.helpers')(after_each)
-local uv = require('luv')
local clear = helpers.clear
local exec_lua = helpers.exec_lua
@@ -293,7 +292,7 @@ describe('vim.fs', function()
eq('/', vim.fs.normalize('/'))
end)
it('works with ~', function()
- eq(vim.fs.normalize(uv.os_homedir()) .. '/src/foo', vim.fs.normalize('~/src/foo'))
+ eq(vim.fs.normalize(vim.uv.os_homedir()) .. '/src/foo', vim.fs.normalize('~/src/foo'))
end)
it('works with environment variables', function()
local xdg_config_home = test_build_dir .. '/.config'
diff --git a/test/functional/lua/loop_spec.lua b/test/functional/lua/loop_spec.lua
index 38d6f1c24f..3bce30bffb 100644
--- a/test/functional/lua/loop_spec.lua
+++ b/test/functional/lua/loop_spec.lua
@@ -24,13 +24,11 @@ describe('vim.uv', function()
exec_lua('vim.api.nvim_set_var("coroutine_cnt", 0)', {})
local code = [[
- local uv = vim.uv
-
local touch = 0
local function wait(ms)
local this = coroutine.running()
assert(this)
- local timer = uv.new_timer()
+ local timer = vim.uv.new_timer()
timer:start(ms, 0, vim.schedule_wrap(function ()
timer:close()
touch = touch + 1
diff --git a/test/functional/options/autochdir_spec.lua b/test/functional/options/autochdir_spec.lua
index 392c02b07e..5d6cf5082a 100644
--- a/test/functional/options/autochdir_spec.lua
+++ b/test/functional/options/autochdir_spec.lua
@@ -1,4 +1,3 @@
-local luv = require('luv')
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local eq = helpers.eq
@@ -21,7 +20,7 @@ describe("'autochdir'", function()
end)
it('is not overwritten by getwinvar() call #17609', function()
- local curdir = string.gsub(luv.cwd(), '\\', '/')
+ local curdir = vim.uv.cwd():gsub('\\', '/')
local dir_a = curdir .. '/Xtest-functional-options-autochdir.dir_a'
local dir_b = curdir .. '/Xtest-functional-options-autochdir.dir_b'
mkdir(dir_a)
diff --git a/test/functional/plugin/shada_spec.lua b/test/functional/plugin/shada_spec.lua
index ef3fef1897..59ddd8f3ce 100644
--- a/test/functional/plugin/shada_spec.lua
+++ b/test/functional/plugin/shada_spec.lua
@@ -14,8 +14,6 @@ local eq, meths, nvim_eval, nvim_command, nvim, exc_exec, funcs, nvim_feed, curb
local neq = helpers.neq
local read_file = helpers.read_file
-local mpack = require('mpack')
-
local shada_helpers = require('test.functional.shada.helpers')
local get_shada_rw = shada_helpers.get_shada_rw
@@ -26,7 +24,7 @@ end
local mpack_eq = function(expected, mpack_result)
local mpack_keys = { 'type', 'timestamp', 'length', 'value' }
- local unpack = mpack.Unpacker()
+ local unpack = vim.mpack.Unpacker()
local actual = {}
local cur, val
local i = 0
diff --git a/test/functional/shada/helpers.lua b/test/functional/shada/helpers.lua
index b8d0352862..d8ffdaf753 100644
--- a/test/functional/shada/helpers.lua
+++ b/test/functional/shada/helpers.lua
@@ -3,8 +3,6 @@ local meths = helpers.meths
local write_file = helpers.write_file
local concat_tables = helpers.concat_tables
-local mpack = require('mpack')
-
local tmpname = helpers.tmpname()
-- o={
@@ -64,7 +62,7 @@ local read_shada_file = function(fname)
local fd = io.open(fname, 'r')
local mstring = fd:read('*a')
fd:close()
- local unpack = mpack.Unpacker()
+ local unpack = vim.mpack.Unpacker()
local ret = {}
local cur, val
local i = 0
diff --git a/test/functional/shada/shada_spec.lua b/test/functional/shada/shada_spec.lua
index 9e3d2f7a58..4b52c1835b 100644
--- a/test/functional/shada/shada_spec.lua
+++ b/test/functional/shada/shada_spec.lua
@@ -6,11 +6,9 @@ local write_file, spawn, set_session, nvim_prog, exc_exec =
local is_os = helpers.is_os
local skip = helpers.skip
-local luv = require('luv')
+local uv = vim.uv
local paths = require('test.cmakeconfig.paths')
-local mpack = require('mpack')
-
local shada_helpers = require('test.functional.shada.helpers')
local reset, clear, get_shada_rw =
shada_helpers.reset, shada_helpers.clear, shada_helpers.get_shada_rw
@@ -26,7 +24,7 @@ describe('ShaDa support code', function()
after_each(function()
clear()
clean()
- luv.fs_rmdir(dirname)
+ uv.fs_rmdir(dirname)
end)
it('preserves `s` item size limit with unknown entries', function()
@@ -87,7 +85,7 @@ describe('ShaDa support code', function()
wshada('Some text file')
eq(0, exc_exec('wshada! ' .. shada_fname))
eq(1, read_shada_file(shada_fname)[1].type)
- eq(nil, luv.fs_stat(shada_fname .. '.tmp.a'))
+ eq(nil, uv.fs_stat(shada_fname .. '.tmp.a'))
end
)
@@ -148,11 +146,11 @@ describe('ShaDa support code', function()
wshada(s .. table.concat(msgpack, e .. s) .. e)
eq(0, exc_exec('wshada ' .. shada_fname))
local found = 0
- local typ = mpack.decode(s)
+ local typ = vim.mpack.decode(s)
for _, v in ipairs(read_shada_file(shada_fname)) do
if v.type == typ then
found = found + 1
- eq(mpack.decode(msgpack[found]), v.timestamp)
+ eq(vim.mpack.decode(msgpack[found]), v.timestamp)
end
end
eq(#msgpack, found)
@@ -279,8 +277,8 @@ describe('ShaDa support code', function()
true
)
session:close()
- eq(nil, luv.fs_stat('NONE'))
- eq(nil, luv.fs_stat('NONE.tmp.a'))
+ eq(nil, uv.fs_stat('NONE'))
+ eq(nil, uv.fs_stat('NONE.tmp.a'))
end)
it('does not read NONE file', function()
diff --git a/test/functional/ui/embed_spec.lua b/test/functional/ui/embed_spec.lua
index 1ce465eaae..a9506f2b38 100644
--- a/test/functional/ui/embed_spec.lua
+++ b/test/functional/ui/embed_spec.lua
@@ -1,4 +1,4 @@
-local uv = require 'luv'
+local uv = vim.uv
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
diff --git a/test/functional/vimscript/buf_functions_spec.lua b/test/functional/vimscript/buf_functions_spec.lua
index c17edfad62..1b722247a8 100644
--- a/test/functional/vimscript/buf_functions_spec.lua
+++ b/test/functional/vimscript/buf_functions_spec.lua
@@ -1,7 +1,5 @@
local helpers = require('test.functional.helpers')(after_each)
-local luv = require('luv')
-
local eq = helpers.eq
local clear = helpers.clear
local funcs = helpers.funcs
@@ -87,7 +85,7 @@ describe('bufname() function', function()
it('returns expected buffer name', function()
eq('', funcs.bufname('%')) -- Buffer has no name yet
command('file ' .. fname)
- local wd = luv.cwd()
+ local wd = vim.uv.cwd()
local sep = get_pathsep()
local curdirname = funcs.fnamemodify(wd, ':t')
for _, arg in ipairs({ '%', 1, 'X', wd }) do
@@ -120,7 +118,7 @@ describe('bufnr() function', function()
it('returns expected buffer number', function()
eq(1, funcs.bufnr('%'))
command('file ' .. fname)
- local wd = luv.cwd()
+ local wd = vim.uv.cwd()
local curdirname = funcs.fnamemodify(wd, ':t')
eq(1, funcs.bufnr(fname))
eq(1, funcs.bufnr(wd))
diff --git a/test/functional/vimscript/glob_spec.lua b/test/functional/vimscript/glob_spec.lua
index ea49552310..77351f95fa 100644
--- a/test/functional/vimscript/glob_spec.lua
+++ b/test/functional/vimscript/glob_spec.lua
@@ -1,4 +1,3 @@
-local luv = require('luv')
local helpers = require('test.functional.helpers')(after_each)
local clear, command, eval, eq = helpers.clear, helpers.command, helpers.eval, helpers.eq
local mkdir = helpers.mkdir
@@ -12,7 +11,7 @@ before_each(function()
end)
after_each(function()
- luv.fs_rmdir('test-glob')
+ vim.uv.fs_rmdir('test-glob')
end)
describe('glob()', function()
diff --git a/test/functional/vimscript/has_spec.lua b/test/functional/vimscript/has_spec.lua
index 4e232daeb3..c797a3bbf9 100644
--- a/test/functional/vimscript/has_spec.lua
+++ b/test/functional/vimscript/has_spec.lua
@@ -62,8 +62,7 @@ describe('has()', function()
end)
it('"wsl"', function()
- local luv = require('luv')
- local is_wsl = luv.os_uname()['release']:lower():match('microsoft') and true or false
+ local is_wsl = vim.uv.os_uname()['release']:lower():match('microsoft') and true or false
if is_wsl then
eq(1, funcs.has('wsl'))
else
diff --git a/test/functional/vimscript/writefile_spec.lua b/test/functional/vimscript/writefile_spec.lua
index b83d6c4a25..f03baa6ddd 100644
--- a/test/functional/vimscript/writefile_spec.lua
+++ b/test/functional/vimscript/writefile_spec.lua
@@ -1,5 +1,4 @@
local helpers = require('test.functional.helpers')(after_each)
-local luv = require('luv')
local mkdir = helpers.mkdir
local clear = helpers.clear
@@ -28,8 +27,8 @@ end)
after_each(function()
os.remove(fname)
os.remove(dfname)
- luv.fs_rmdir(ddname)
- luv.fs_rmdir(dname)
+ vim.uv.fs_rmdir(ddname)
+ vim.uv.fs_rmdir(dname)
end)
describe('writefile()', function()