aboutsummaryrefslogtreecommitdiff
path: root/test/unit/path_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-01-14 23:10:03 -0700
committerJosh Rahm <joshuarahm@gmail.com>2023-01-14 23:10:03 -0700
commit396c48d54ef313ca02e2e97849e51721094400cd (patch)
tree87857ac4a5a7f88e2ebc519e73df061f9ed2f8e1 /test/unit/path_spec.lua
parent968aa6e3ed0497ea99f123c74c5fd0f3880ccc63 (diff)
parent6134c1e8a39a5e61d0593613343a5923a86e3545 (diff)
downloadrneovim-396c48d54ef313ca02e2e97849e51721094400cd.tar.gz
rneovim-396c48d54ef313ca02e2e97849e51721094400cd.tar.bz2
rneovim-396c48d54ef313ca02e2e97849e51721094400cd.zip
Merge remote-tracking branch 'upstream/master' into userreg
Diffstat (limited to 'test/unit/path_spec.lua')
-rw-r--r--test/unit/path_spec.lua16
1 files changed, 13 insertions, 3 deletions
diff --git a/test/unit/path_spec.lua b/test/unit/path_spec.lua
index eb23a3cff1..1fc4e2496e 100644
--- a/test/unit/path_spec.lua
+++ b/test/unit/path_spec.lua
@@ -82,8 +82,8 @@ describe('path.c', function()
local f2 = 'f2.o'
before_each(function()
-- create the three files that will be used in this spec
- io.open(f1, 'w').close()
- io.open(f2, 'w').close()
+ io.open(f1, 'w'):close()
+ io.open(f2, 'w'):close()
end)
after_each(function()
@@ -355,7 +355,7 @@ end)
describe('path.c', function()
setup(function()
lfs.mkdir('unit-test-directory');
- io.open('unit-test-directory/test.file', 'w').close()
+ io.open('unit-test-directory/test.file', 'w'):close()
-- Since the tests are executed, they are called by an executable. We use
-- that executable for several asserts.
@@ -504,6 +504,16 @@ describe('path.c', function()
eq(OK, result)
end)
+ itp('does not remove trailing slash from non-existing relative directory #20847', function()
+ local expected = lfs.currentdir() .. '/non_existing_dir/'
+ local filename = 'non_existing_dir/'
+ 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('expands "./" to the current directory #7117', function()
local expected = lfs.currentdir() .. '/unit-test-directory/test.file'
local filename = './unit-test-directory/test.file'