aboutsummaryrefslogtreecommitdiff
path: root/test/functional/options/autochdir_spec.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-01-12 19:40:58 +0000
committerGitHub <noreply@github.com>2024-01-12 19:40:58 +0000
commit07a7c0ec999102f223a6aca17e93d33e18c02b94 (patch)
tree221ea513b45596f8e63035955494167fc20bf826 /test/functional/options/autochdir_spec.lua
parent7f249936a989dbc21ad03e394197afc07cb9c0bf (diff)
parent795f896a5772d5e0795f86642bdf90c82efac45c (diff)
downloadrneovim-07a7c0ec999102f223a6aca17e93d33e18c02b94.tar.gz
rneovim-07a7c0ec999102f223a6aca17e93d33e18c02b94.tar.bz2
rneovim-07a7c0ec999102f223a6aca17e93d33e18c02b94.zip
Merge pull request #26994 from lewis6991/vimhelpers
test: big cleanup
Diffstat (limited to 'test/functional/options/autochdir_spec.lua')
-rw-r--r--test/functional/options/autochdir_spec.lua21
1 files changed, 10 insertions, 11 deletions
diff --git a/test/functional/options/autochdir_spec.lua b/test/functional/options/autochdir_spec.lua
index 392c02b07e..11f71912a9 100644
--- a/test/functional/options/autochdir_spec.lua
+++ b/test/functional/options/autochdir_spec.lua
@@ -1,8 +1,7 @@
-local luv = require('luv')
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local eq = helpers.eq
-local funcs = helpers.funcs
+local fn = helpers.fn
local command = helpers.command
local mkdir = helpers.mkdir
@@ -12,16 +11,16 @@ describe("'autochdir'", function()
-- By default 'autochdir' is off, thus getcwd() returns the repo root.
clear(targetdir .. '/tty-test.c')
- local rootdir = funcs.getcwd()
+ local rootdir = fn.getcwd()
local expected = rootdir .. '/' .. targetdir
-- With 'autochdir' on, we should get the directory of tty-test.c.
clear('--cmd', 'set autochdir', targetdir .. '/tty-test.c')
- eq(helpers.is_os('win') and expected:gsub('/', '\\') or expected, funcs.getcwd())
+ eq(helpers.is_os('win') and expected:gsub('/', '\\') or expected, fn.getcwd())
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)
@@ -30,15 +29,15 @@ describe("'autochdir'", function()
command('set shellslash')
command('set autochdir')
command('edit ' .. dir_a .. '/file1')
- eq(dir_a, funcs.getcwd())
+ eq(dir_a, fn.getcwd())
command('lcd ' .. dir_b)
- eq(dir_b, funcs.getcwd())
+ eq(dir_b, fn.getcwd())
command('botright vnew ../file2')
- eq(curdir, funcs.getcwd())
+ eq(curdir, fn.getcwd())
command('wincmd w')
- eq(dir_a, funcs.getcwd())
- funcs.getwinvar(2, 'foo')
- eq(dir_a, funcs.getcwd())
+ eq(dir_a, fn.getcwd())
+ fn.getwinvar(2, 'foo')
+ eq(dir_a, fn.getcwd())
helpers.rmdir(dir_a)
helpers.rmdir(dir_b)
end)