view src/testdir/test_fnameescape.vim @ 18086:9d6832a5426f v8.1.2038

patch 8.1.2038: has('vimscript-4') is always 0 Commit: https://github.com/vim/vim/commit/af9143833865a2d8311e57313023271720442f90 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 15 17:49:10 2019 +0200 patch 8.1.2038: has('vimscript-4') is always 0 Problem: has('vimscript-4') is always 0. Solution: Add "vimscript-4" to the feature table. (Naruhiko Nishino, closes #4941)
author Bram Moolenaar <Bram@vim.org>
date Sun, 15 Sep 2019 18:00:03 +0200
parents 73ddc462979d
children b8fd7364befd
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)
endfunc