diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-02-21 17:54:45 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-02-21 17:54:45 +0100 |
commit | 818fc9ad143911b2faa0d7cee86724aa70a02080 (patch) | |
tree | e720688cb917f3fdd28739a4fc2340b270332235 /src/testdir/test_cmdline.vim | |
parent | 09f28f49c9b5973593f8a9b445cdc2ed3da630b6 (diff) |
patch 8.2.0293: various Ex commands not sufficiently testedv8.2.0293
Problem: Various Ex commands not sufficiently tested.
Solution: Add more test cases. (Yegappan Lakshmanan, closes #5673)
Diffstat (limited to 'src/testdir/test_cmdline.vim')
-rw-r--r-- | src/testdir/test_cmdline.vim | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index ff15cbbe3b..545f09b16f 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -977,4 +977,33 @@ func Test_cmd_backtick() %argd 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 + " vim: shiftwidth=2 sts=2 expandtab |