mirror of
https://github.com/neovim/neovim.git
synced 2026-05-23 21:30:11 +00:00
test(vim.fs): basename(), dirname() trim trailing slashes #39790
close #37698
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user