aboutsummaryrefslogtreecommitdiff
path: root/test/unit/path_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-03-24 13:56:55 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-03-24 14:17:40 +0100
commit7ae41442088a4b1b1cd324b683defd87998ba75c (patch)
treef6074ac4c2c317fb6546f97da2b894d411b98fc8 /test/unit/path_spec.lua
parent998a16c926623a667ecb0228f4a6cd8ba1e90201 (diff)
downloadrneovim-7ae41442088a4b1b1cd324b683defd87998ba75c.tar.gz
rneovim-7ae41442088a4b1b1cd324b683defd87998ba75c.tar.bz2
rneovim-7ae41442088a4b1b1cd324b683defd87998ba75c.zip
refactor/rename: path_try_shorten_fname()
Diffstat (limited to 'test/unit/path_spec.lua')
-rw-r--r--test/unit/path_spec.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/unit/path_spec.lua b/test/unit/path_spec.lua
index 1bd20b1da9..e8ce660ce1 100644
--- a/test/unit/path_spec.lua
+++ b/test/unit/path_spec.lua
@@ -261,7 +261,7 @@ describe('path.c', function()
end)
end)
-describe('path_shorten_fname_if_possible', function()
+describe('path_try_shorten_fname', function()
local cwd = lfs.currentdir()
before_each(function()
@@ -273,22 +273,22 @@ describe('path_shorten_fname_if_possible', function()
lfs.rmdir('ut_directory')
end)
- describe('path_shorten_fname_if_possible', function()
+ describe('path_try_shorten_fname', function()
itp('returns shortened path if possible', function()
lfs.chdir('ut_directory')
local full = to_cstr(lfs.currentdir() .. '/subdir/file.txt')
- eq('subdir/file.txt', (ffi.string(cimp.path_shorten_fname_if_possible(full))))
+ eq('subdir/file.txt', (ffi.string(cimp.path_try_shorten_fname(full))))
end)
itp('returns `full_path` if a shorter version is not possible', function()
local old = lfs.currentdir()
lfs.chdir('ut_directory')
local full = old .. '/subdir/file.txt'
- eq(full, (ffi.string(cimp.path_shorten_fname_if_possible(to_cstr(full)))))
+ eq(full, (ffi.string(cimp.path_try_shorten_fname(to_cstr(full)))))
end)
itp('returns NULL if `full_path` is NULL', function()
- eq(NULL, (cimp.path_shorten_fname_if_possible(NULL)))
+ eq(NULL, (cimp.path_try_shorten_fname(NULL)))
end)
end)
end)