aboutsummaryrefslogtreecommitdiff
path: root/test/unit/path_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-01-25 18:23:01 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-01-25 18:23:01 +0000
commit142d9041391780ac15b89886a54015fdc5c73995 (patch)
tree0f6b5cac1a60810a03f52826c9e67c9e2780b033 /test/unit/path_spec.lua
parentad86b5db74922285699ab2a1dbb2ff20e6268a33 (diff)
parent3c48d3c83fc21dbc0841f9210f04bdb073d73cd1 (diff)
downloadrneovim-142d9041391780ac15b89886a54015fdc5c73995.tar.gz
rneovim-142d9041391780ac15b89886a54015fdc5c73995.tar.bz2
rneovim-142d9041391780ac15b89886a54015fdc5c73995.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'