view src/testdir/test_fnameescape.vim @ 19748:d089bd9511c0 v8.2.0430

patch 8.2.0430: window creation failure not properly tested Commit: https://github.com/vim/vim/commit/5080b0a0470511bae6176a704d4591d1caba0d07 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 22 21:23:47 2020 +0100 patch 8.2.0430: window creation failure not properly tested Problem: Window creation failure not properly tested. Solution: Improve the test. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5826)
author Bram Moolenaar <Bram@vim.org>
date Sun, 22 Mar 2020 21:30:04 +0100
parents b8fd7364befd
children 08940efa6b4e
line wrap: on
line source


" Test if fnameescape is correct for special chars like !
func Test_fnameescape()
  let fname = 'Xspa ce'
  let status = v:false
  try
    exe "w! " . fnameescape(fname)
    let status = v:true
  endtry
  call assert_true(status, "Space")
  call delete(fname)

  let fname = 'Xemark!'
  let status = v:false
  try
    exe "w! " . fname->fnameescape()
    let status = v:true
  endtry
  call assert_true(status, "ExclamationMark")
  call delete(fname)

  call assert_equal('\-', fnameescape('-'))
  call assert_equal('\+', fnameescape('+'))
  call assert_equal('\>', fnameescape('>'))
endfunc

" vim: shiftwidth=2 sts=2 expandtab