mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
fix(api): use changedir_func() in nvim_set_current_dir()
Co-Authored-By: smolck <46855713+smolck@users.noreply.github.com>
This commit is contained in:
@@ -536,6 +536,31 @@ describe('API', function()
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('nvim_set_current_dir', function()
|
||||
local start_dir
|
||||
|
||||
before_each(function()
|
||||
clear()
|
||||
funcs.mkdir("Xtestdir")
|
||||
start_dir = funcs.getcwd()
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
helpers.rmdir("Xtestdir")
|
||||
end)
|
||||
|
||||
it('works', function()
|
||||
meths.set_current_dir("Xtestdir")
|
||||
eq(funcs.getcwd(), start_dir .. helpers.get_pathsep() .. "Xtestdir")
|
||||
end)
|
||||
|
||||
it('sets previous directory', function()
|
||||
meths.set_current_dir("Xtestdir")
|
||||
meths.exec('cd -', false)
|
||||
eq(funcs.getcwd(), start_dir)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('nvim_exec_lua', function()
|
||||
it('works', function()
|
||||
meths.exec_lua('vim.api.nvim_set_var("test", 3)', {})
|
||||
|
||||
Reference in New Issue
Block a user