view src/testdir/test_vim9_cmd.vim @ 20211:3a94b984c9f9 v8.2.0661

patch 8.2.0661: eval test is still old style Commit: https://github.com/vim/vim/commit/339d60c89bef0315343a6128a1b4826510b0efe4 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 29 22:01:21 2020 +0200 patch 8.2.0661: eval test is still old style Problem: Eval test is still old style. Solution: Change into new style tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/6009)
author Bram Moolenaar <Bram@vim.org>
date Wed, 29 Apr 2020 22:15:04 +0200
parents 1d84eaed0ec8
children e29b2ec8d4d2
line wrap: on
line source

" Test commands that are not compiled in a :def function

source check.vim
source vim9.vim

def Test_edit_wildcards()
  let filename = 'Xtest'
  edit `=filename`
  assert_equal('Xtest', bufname())

  let filenr = 123
  edit Xtest`=filenr`
  assert_equal('Xtest123', bufname())

  filenr = 77
  edit `=filename``=filenr`
  assert_equal('Xtest77', bufname())

  edit X`=filename`xx`=filenr`yy
  assert_equal('XXtestxx77yy', bufname())
enddef

def Test_hardcopy_wildcards()
  CheckUnix
  CheckFeature postscript

  let outfile = 'print'
  hardcopy > X`=outfile`.ps
  assert_true(filereadable('Xprint.ps'))

  delete('Xprint.ps')
enddef

def Test_syn_include_wildcards()
  writefile(['syn keyword Found found'], 'Xthemine.vim')
  let save_rtp = &rtp
  &rtp = '.'

  let fname = 'mine'
  syn include @Group Xthe`=fname`.vim
  assert_match('Found.* contained found', execute('syn list Found'))

  &rtp = save_rtp
  delete('Xthemine.vim')
enddef


" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker