view src/testdir/test_fnameescape.vim @ 23467:826a6406ea7b v8.2.2276

patch 8.2.2276: list of distributed files is outdated Commit: https://github.com/vim/vim/commit/a72514945bc3edd4fc4d745004e37c5d5487c98d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 2 16:53:13 2021 +0100 patch 8.2.2276: list of distributed files is outdated Problem: List of distributed files is outdated. Solution: Update the file list. Minor comment updates.
author Bram Moolenaar <Bram@vim.org>
date Sat, 02 Jan 2021 17:00:04 +0100
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