mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
vim-patch:8.2.3468: problem with :cd when editing file in non-existent directory
Problem: Problem with :cd when editing file in non-existent directory. (Yee
Cheng Chin)
Solution: Prepend the current directory to get the full path. (closes vim/vim#8903)
c6376c7984
This commit is contained in:
@@ -54,15 +54,21 @@ describe('path.c', function()
|
||||
eq(lfs.currentdir(), (ffi.string(buffer)))
|
||||
end)
|
||||
|
||||
itp('fails if the given directory does not exist', function()
|
||||
eq(FAIL, path_full_dir_name('does_not_exist', buffer, length))
|
||||
end)
|
||||
|
||||
itp('works with a normal relative dir', function()
|
||||
local result = path_full_dir_name('unit-test-directory', buffer, length)
|
||||
eq(lfs.currentdir() .. '/unit-test-directory', (ffi.string(buffer)))
|
||||
eq(OK, result)
|
||||
end)
|
||||
|
||||
itp('works with a non-existing relative dir', function()
|
||||
local result = path_full_dir_name('does-not-exist', buffer, length)
|
||||
eq(lfs.currentdir() .. '/does-not-exist', (ffi.string(buffer)))
|
||||
eq(OK, result)
|
||||
end)
|
||||
|
||||
itp('fails with a non-existing absolute dir', function()
|
||||
eq(FAIL, path_full_dir_name('/does_not_exist', buffer, length))
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('path_full_compare', function()
|
||||
|
||||
Reference in New Issue
Block a user