diff options
author | Gregory Anders <greg@gpanders.com> | 2022-05-15 19:55:18 -0600 |
---|---|---|
committer | Gregory Anders <greg@gpanders.com> | 2022-05-31 13:04:41 -0600 |
commit | b740709431f5e68dac5238d455f9f86d5a564f36 (patch) | |
tree | 0df53aec490c87343dd7b15addf46f2c694d08c7 /test/functional/lua/fs_spec.lua | |
parent | c5526a27c3b61acb33b7c3c3fe518d8f1e0b602f (diff) | |
download | rneovim-b740709431f5e68dac5238d455f9f86d5a564f36.tar.gz rneovim-b740709431f5e68dac5238d455f9f86d5a564f36.tar.bz2 rneovim-b740709431f5e68dac5238d455f9f86d5a564f36.zip |
feat(fs): add vim.fs.basename()
Diffstat (limited to 'test/functional/lua/fs_spec.lua')
-rw-r--r-- | test/functional/lua/fs_spec.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/lua/fs_spec.lua b/test/functional/lua/fs_spec.lua index 23ffb1e607..674a7f6957 100644 --- a/test/functional/lua/fs_spec.lua +++ b/test/functional/lua/fs_spec.lua @@ -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) |