aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds
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/ex_cmds
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/ex_cmds')
-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
5 files changed, 11 insertions, 15 deletions
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)