feat(fs): add vim.fs.basename()

This commit is contained in:
Gregory Anders
2022-05-15 19:55:18 -06:00
parent c5526a27c3
commit b740709431
3 changed files with 30 additions and 0 deletions

View File

@@ -7,6 +7,10 @@ local mkdir_p = helpers.mkdir_p
local rmdir = helpers.rmdir
local nvim_dir = helpers.nvim_dir
local test_build_dir = helpers.test_build_dir
local iswin = helpers.iswin
local nvim_prog = helpers.nvim_prog
local nvim_prog_basename = iswin() and 'nvim.exe' or 'nvim'
before_each(clear)
@@ -39,4 +43,13 @@ describe('vim.fs', function()
]], nvim_dir))
end)
end)
describe('basename()', function()
it('works', function()
eq(nvim_prog_basename, exec_lua([[
local nvim_prog = ...
return vim.fs.basename(nvim_prog)
]], nvim_prog))
end)
end)
end)