neovim/test/functional/legacy/102_fnameescape_spec.lua
ZyX ff470bb853 functests: Check logs in lua code
It is otherwise impossible to determine which test failed sanitizer/valgrind
check. test/functional/helpers.lua module return was changed so that tests which
do not provide after_each function to get new check will automatically fail.
2016-06-10 21:50:49 +03:00

27 lines
679 B
Lua

-- Test if fnameescape is correct for special chars like!
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local execute, expect = helpers.execute, helpers.expect
describe('fnameescape', function()
setup(clear)
it('is working', function()
execute('let fname = "Xspa ce"')
execute('try', 'exe "w! " . fnameescape(fname)', "put='Space'", 'endtry')
execute('let fname = "Xemark!"')
execute('try', 'exe "w! " . fnameescape(fname)', "put='ExclamationMark'", 'endtry')
expect([[
Space
ExclamationMark]])
end)
teardown(function()
os.remove("Xspa ce")
os.remove("Xemark!")
end)
end)