test: fnamemodify()

This commit is contained in:
Justin M. Keyes 2018-01-09 01:06:59 +01:00 committed by Jan Edmund Lazo
parent 499c9a1553
commit afbdafffc2

View 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)