aboutsummaryrefslogtreecommitdiff
path: root/test/unit/path_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2021-11-19 20:07:04 +0800
committerzeertzjq <zeertzjq@outlook.com>2021-11-19 20:07:04 +0800
commit0f58ba10e264697e4bb330a17b41cd9a0ceb8b1e (patch)
tree94b8fa70be765d992258217aad3f00d5cb35732c /test/unit/path_spec.lua
parentf71be1f87b40bf863b6cf6b4fbcebffdd3297d88 (diff)
downloadrneovim-0f58ba10e264697e4bb330a17b41cd9a0ceb8b1e.tar.gz
rneovim-0f58ba10e264697e4bb330a17b41cd9a0ceb8b1e.tar.bz2
rneovim-0f58ba10e264697e4bb330a17b41cd9a0ceb8b1e.zip
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) https://github.com/vim/vim/commit/c6376c798433bcb9ee38a8664299d11454546950
Diffstat (limited to 'test/unit/path_spec.lua')
-rw-r--r--test/unit/path_spec.lua14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/unit/path_spec.lua b/test/unit/path_spec.lua
index 41954de9be..15ce59747e 100644
--- a/test/unit/path_spec.lua
+++ b/test/unit/path_spec.lua
@@ -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()