Bram Moolenaar | cfe435d | 2020-04-25 20:02:55 +0200 | [diff] [blame] | 1 | " Test commands that are not compiled in a :def function |
| 2 | |
Bram Moolenaar | 6378c4f | 2020-04-26 13:50:41 +0200 | [diff] [blame^] | 3 | source check.vim |
Bram Moolenaar | cfe435d | 2020-04-25 20:02:55 +0200 | [diff] [blame] | 4 | source vim9.vim |
| 5 | |
| 6 | def Test_edit_wildcards() |
| 7 | let filename = 'Xtest' |
| 8 | edit `=filename` |
| 9 | assert_equal('Xtest', bufname()) |
| 10 | |
| 11 | let filenr = 123 |
| 12 | edit Xtest`=filenr` |
| 13 | assert_equal('Xtest123', bufname()) |
| 14 | |
| 15 | filenr = 77 |
| 16 | edit `=filename``=filenr` |
| 17 | assert_equal('Xtest77', bufname()) |
| 18 | |
| 19 | edit X`=filename`xx`=filenr`yy |
| 20 | assert_equal('XXtestxx77yy', bufname()) |
| 21 | enddef |
| 22 | |
Bram Moolenaar | 6378c4f | 2020-04-26 13:50:41 +0200 | [diff] [blame^] | 23 | def Test_hardcopy_wildcards() |
| 24 | CheckUnix |
| 25 | CheckFeature postscript |
| 26 | |
| 27 | let outfile = 'print' |
| 28 | hardcopy > X`=outfile`.ps |
| 29 | assert_true(filereadable('Xprint.ps')) |
| 30 | |
| 31 | delete('Xprint.ps') |
| 32 | enddef |
| 33 | |
| 34 | def Test_syn_include_wildcards() |
| 35 | writefile(['syn keyword Found found'], 'Xthemine.vim') |
| 36 | let save_rtp = &rtp |
| 37 | &rtp = '.' |
| 38 | |
| 39 | let fname = 'mine' |
| 40 | syn include @Group Xthe`=fname`.vim |
| 41 | assert_match('Found.* contained found', execute('syn list Found')) |
| 42 | |
| 43 | &rtp = save_rtp |
| 44 | delete('Xthemine.vim') |
| 45 | enddef |
| 46 | |
Bram Moolenaar | cfe435d | 2020-04-25 20:02:55 +0200 | [diff] [blame] | 47 | |
| 48 | " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker |