mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test: fnamemodify()
This commit is contained in:
parent
499c9a1553
commit
afbdafffc2
21
test/functional/eval/fnamemodify_spec.lua
Normal file
21
test/functional/eval/fnamemodify_spec.lua
Normal file
@ -0,0 +1,21 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local iswin = helpers.iswin
|
||||
local fnamemodify = helpers.funcs.fnamemodify
|
||||
|
||||
describe('fnamemodify()', function()
|
||||
before_each(clear)
|
||||
|
||||
it('works', function()
|
||||
if iswin() then
|
||||
eq([[C:\]], fnamemodify([[\]], ':p:h'))
|
||||
eq([[C:\]], fnamemodify([[\]], ':p'))
|
||||
eq([[C:/]], fnamemodify([[/]], ':p:h'))
|
||||
eq([[C:/]], fnamemodify([[/]], ':p'))
|
||||
else
|
||||
eq('/', fnamemodify([[/]], ':p:h'))
|
||||
eq('/', fnamemodify([[/]], ':p'))
|
||||
end
|
||||
end)
|
||||
end)
|
Loading…
Reference in New Issue
Block a user