aboutsummaryrefslogtreecommitdiff
path: root/test/unit/path_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-11-19 22:57:13 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-11-19 22:57:13 +0000
commit9be89f131f87608f224f0ee06d199fcd09d32176 (patch)
tree11022dcfa9e08cb4ac5581b16734196128688d48 /test/unit/path_spec.lua
parentff7ed8f586589d620a806c3758fac4a47a8e7e15 (diff)
parent88085c2e80a7e3ac29aabb6b5420377eed99b8b6 (diff)
downloadrneovim-9be89f131f87608f224f0ee06d199fcd09d32176.tar.gz
rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.tar.bz2
rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/unit/path_spec.lua')
-rw-r--r--test/unit/path_spec.lua34
1 files changed, 17 insertions, 17 deletions
diff --git a/test/unit/path_spec.lua b/test/unit/path_spec.lua
index 6f6a80f44e..ffad552a8a 100644
--- a/test/unit/path_spec.lua
+++ b/test/unit/path_spec.lua
@@ -468,8 +468,11 @@ describe('path.c', function()
eq(OK, result)
end)
- itp('concatenates directory name if it does not contain a slash', function()
- local expected = uv.cwd() .. '/..'
+ itp('produces absolute path for .. without a slash', function()
+ local old_dir = uv.cwd()
+ uv.chdir('..')
+ local expected = uv.cwd()
+ uv.chdir(old_dir)
local filename = '..'
local buflen = get_buf_len(expected, filename)
local do_expand = 1
@@ -478,21 +481,18 @@ describe('path.c', function()
eq(OK, result)
end)
- itp(
- 'enters given directory (instead of just concatenating the strings) if possible and if path contains a slash',
- function()
- local old_dir = uv.cwd()
- uv.chdir('..')
- local expected = uv.cwd() .. '/test.file'
- uv.chdir(old_dir)
- local filename = '../test.file'
- local buflen = get_buf_len(expected, filename)
- local do_expand = 1
- local buf, result = vim_FullName(filename, buflen, do_expand)
- eq(expected, ffi.string(buf))
- eq(OK, result)
- end
- )
+ itp('produces absolute path if possible and if path contains a slash', function()
+ local old_dir = uv.cwd()
+ uv.chdir('..')
+ local expected = uv.cwd() .. '/test.file'
+ uv.chdir(old_dir)
+ local filename = '../test.file'
+ local buflen = get_buf_len(expected, filename)
+ local do_expand = 1
+ local buf, result = vim_FullName(filename, buflen, do_expand)
+ eq(expected, ffi.string(buf))
+ eq(OK, result)
+ end)
itp('just copies the path if it is already absolute and force=0', function()
local absolute_path = '/absolute/path'