test: fnamemodify with :8 filename modifier

This commit is contained in:
Jan Edmund Lazo
2018-01-13 08:25:11 -05:00
parent 984a93df96
commit 5a39d2d00e

View File

@@ -4,10 +4,19 @@ local eq = helpers.eq
local iswin = helpers.iswin
local fnamemodify = helpers.funcs.fnamemodify
local command = helpers.command
local write_file = helpers.write_file
describe('fnamemodify()', function()
setup(function()
write_file('Xtest-fnamemodify.txt', [[foobar]])
end)
before_each(clear)
teardown(function()
os.remove('Xtest-fnamemodify.txt')
end)
it('works', function()
if iswin() then
local drive_f = io.popen('for %P in (%CD%) do @echo %~dP', 'r')
@@ -29,4 +38,8 @@ describe('fnamemodify()', function()
eq('/', fnamemodify([[/]], ':p'))
end
end)
it(':8 works', function()
eq('Xtest-fnamemodify.txt', fnamemodify([[Xtest-fnamemodify.txt]], ':8'))
end)
end)