view src/testdir/test_fnameescape.vim @ 25684:ba9d587f0b29 v8.2.3378

patch 8.2.3378: MS-Windows: completing environment variables with % is wrong Commit: https://github.com/vim/vim/commit/6024c0427ce1196344439997d5e41a6f8546368c Author: Albert Liu <albertymliu@gmail.com> Date: Fri Aug 27 20:59:35 2021 +0200 patch 8.2.3378: MS-Windows: completing environment variables with % is wrong Problem: MS-Windows: completing environment variables with % is wrong. Solution: Only complete environment variables with $. (Albert Liu, closes #8791)
author Bram Moolenaar <Bram@vim.org>
date Fri, 27 Aug 2021 21:00:04 +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