2017-03-23 07:42:26 -07:00
|
|
|
|
|
|
|
" Test if fnameescape is correct for special chars like !
|
2020-11-29 23:08:27 -07:00
|
|
|
func Test_fnameescape()
|
2017-03-23 07:42:26 -07:00
|
|
|
let fname = 'Xspa ce'
|
|
|
|
let status = v:false
|
|
|
|
try
|
|
|
|
exe "w! " . fnameescape(fname)
|
|
|
|
let status = v:true
|
2017-03-28 16:30:54 -07:00
|
|
|
endtry
|
2017-03-23 07:42:26 -07:00
|
|
|
call assert_true(status, "Space")
|
|
|
|
call delete(fname)
|
|
|
|
|
|
|
|
let fname = 'Xemark!'
|
|
|
|
let status = v:false
|
|
|
|
try
|
2021-08-08 08:07:40 -07:00
|
|
|
exe "w! " . fname->fnameescape()
|
2017-03-23 07:42:26 -07:00
|
|
|
let status = v:true
|
|
|
|
endtry
|
|
|
|
call assert_true(status, "ExclamationMark")
|
|
|
|
call delete(fname)
|
2021-04-19 11:57:19 -07:00
|
|
|
|
|
|
|
call assert_equal('\-', fnameescape('-'))
|
|
|
|
call assert_equal('\+', fnameescape('+'))
|
|
|
|
call assert_equal('\>', fnameescape('>'))
|
2020-11-29 23:08:27 -07:00
|
|
|
endfunc
|
2021-04-19 11:57:19 -07:00
|
|
|
|
|
|
|
" vim: shiftwidth=2 sts=2 expandtab
|