diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-07-12 14:45:36 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-07-12 16:23:32 +0800 |
| commit | 4aa4675fbface275224d178ebb436bc214dd1056 (patch) | |
| tree | c54a5272b2cc8415b82549ba48381e423791090c /src/nvim/testdir/test_cmdline.vim | |
| parent | 01afd43bc90408b43db906845245a4959c8ee3a0 (diff) | |
| download | rneovim-4aa4675fbface275224d178ebb436bc214dd1056.tar.gz rneovim-4aa4675fbface275224d178ebb436bc214dd1056.tar.bz2 rneovim-4aa4675fbface275224d178ebb436bc214dd1056.zip | |
vim-patch:8.2.0293: various Ex commands not sufficiently tested
Problem: Various Ex commands not sufficiently tested.
Solution: Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5673)
https://github.com/vim/vim/commit/818fc9ad143911b2faa0d7cee86724aa70a02080
Needs to assert E170 instead of E580 because patch 8.2.3486 has been
ported but patch 8.2.1183 hasn't.
Diffstat (limited to 'src/nvim/testdir/test_cmdline.vim')
| -rw-r--r-- | src/nvim/testdir/test_cmdline.vim | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 9885d356fd..3863d25ee7 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -1385,6 +1385,35 @@ func Test_cmdwin_tabpage() tabclose! endfunc +" Test for the :! command +func Test_cmd_bang() + if !has('unix') + return + endif + + let lines =<< trim [SCRIPT] + " Test for no previous command + call assert_fails('!!', 'E34:') + set nomore + " Test for cmdline expansion with :! + call setline(1, 'foo!') + silent !echo <cWORD> > Xfile.out + call assert_equal(['foo!'], readfile('Xfile.out')) + " Test for using previous command + silent !echo \! ! + call assert_equal(['! echo foo!'], readfile('Xfile.out')) + call writefile(v:errors, 'Xresult') + call delete('Xfile.out') + qall! + [SCRIPT] + call writefile(lines, 'Xscript') + if RunVim([], [], '--clean -S Xscript') + call assert_equal([], readfile('Xresult')) + endif + call delete('Xscript') + call delete('Xresult') +endfunc + " Test error: "E135: *Filter* Autocommands must not change current buffer" func Test_cmd_bang_E135() new |