aboutsummaryrefslogtreecommitdiff
path: root/test/unit/path_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/path_spec.lua')
-rw-r--r--test/unit/path_spec.lua20
1 files changed, 17 insertions, 3 deletions
diff --git a/test/unit/path_spec.lua b/test/unit/path_spec.lua
index fb476397e6..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'
@@ -640,6 +650,10 @@ describe('path.c', function()
eq(2, path_with_url([[test-abc:\\xyz\foo\b3]]))
eq(0, path_with_url([[-test://xyz/foo/b4]]))
eq(0, path_with_url([[test-://xyz/foo/b5]]))
+ eq(1, path_with_url([[test-C:/xyz/foo/b5]]))
+ eq(1, path_with_url([[test-custom:/xyz/foo/b5]]))
+ eq(0, path_with_url([[c:/xyz/foo/b5]]))
+ eq(0, path_with_url([[C:/xyz/foo/b5]]))
end)
end)
end)