aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2026-05-14 16:02:31 -0400
committerGitHub <noreply@github.com>2026-05-14 16:02:31 -0400
commit6bb3e1b239e4decd75475d386c1f4e6989eeb898 (patch)
tree47fe5be8538ef5438357dd88a585fdc0ea2af11b /test/functional/lua
parentadb5d8a6460b9005c870467f4dc962278b708a8f (diff)
downloadrneovim-6bb3e1b239e4decd75475d386c1f4e6989eeb898.tar.gz
rneovim-6bb3e1b239e4decd75475d386c1f4e6989eeb898.tar.bz2
rneovim-6bb3e1b239e4decd75475d386c1f4e6989eeb898.zip
test(vim.fs): basename(), dirname() trim trailing slashes #39790
close #37698
Diffstat (limited to 'test/functional/lua')
-rw-r--r--test/functional/lua/fs_spec.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/lua/fs_spec.lua b/test/functional/lua/fs_spec.lua
index de6e9f1350..8ab73650a6 100644
--- a/test/functional/lua/fs_spec.lua
+++ b/test/functional/lua/fs_spec.lua
@@ -100,6 +100,10 @@ describe('vim.fs', function()
test_paths(tests_windows_paths, true)
end
end)
+
+ it('trims redundant slashes #37698', function()
+ eq('/name', vim.fs.dirname('/name//////////'))
+ end)
end)
describe('basename()', function()
@@ -128,6 +132,12 @@ describe('vim.fs', function()
test_paths(tests_windows_paths, true)
end
end)
+
+ it('trims redundant slashes #37698', function()
+ -- XXX: for better or worse, this matches python's `os.path.basename`.
+ -- https://github.com/neovim/neovim/issues/37698#issuecomment-3847866806
+ eq('', vim.fs.basename('/name//////////'))
+ end)
end)
describe('dir()', function()