view src/testdir/test_fnameescape.vim @ 27499:df414fc12eed v8.2.4277

patch 8.2.4277: Vim9: an import does not shadow a command modifier Commit: https://github.com/vim/vim/commit/68854a82fdedebf6ee0675d1abeae6fc627ff6bb Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 31 18:59:13 2022 +0000 patch 8.2.4277: Vim9: an import does not shadow a command modifier Problem: Vim9: an import does not shadow a command modifier. Solution: Do not accept a command modifier followed by a dot.
author Bram Moolenaar <Bram@vim.org>
date Mon, 31 Jan 2022 20:00:06 +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