mirror of
https://github.com/neovim/neovim.git
synced 2026-04-28 10:14:06 +00:00
legacy tests: migrate test102
This commit is contained in:
committed by
Thiago de Arruda
parent
dbc7a8d987
commit
d4f92e521c
26
test/functional/legacy/102_fnameescape_spec.lua
Normal file
26
test/functional/legacy/102_fnameescape_spec.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
-- Test if fnameescape is correct for special chars like!
|
||||
|
||||
local helpers = require('test.functional.helpers')
|
||||
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
|
||||
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)
|
||||
Reference in New Issue
Block a user