view src/testdir/test_fnameescape.vim @ 30831:fbeebe308514 v9.0.0750

patch 9.0.0750: crash when popup closed in callback Commit: https://github.com/vim/vim/commit/0abd6cf62d65180dc2c40d67cd95f13b0691f7ea Author: Bram Moolenaar <Bram@vim.org> Date: Fri Oct 14 17:04:09 2022 +0100 patch 9.0.0750: crash when popup closed in callback Problem: Crash when popup closed in callback. (Maxim Kim) Solution: In syntax_end_parsing() check that syn_block is valid.
author Bram Moolenaar <Bram@vim.org>
date Fri, 14 Oct 2022 18:15:03 +0200
parents 08940efa6b4e
children
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