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_excmd.vim | |
parent | 09f28f49c9b5973593f8a9b445cdc2ed3da630b6 (diff) | |
download | vim-git-818fc9ad143911b2faa0d7cee86724aa70a02080.tar.gz |
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_excmd.vim')
-rw-r--r-- | src/testdir/test_excmd.vim | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/testdir/test_excmd.vim b/src/testdir/test_excmd.vim index 472945d25..c59454864 100644 --- a/src/testdir/test_excmd.vim +++ b/src/testdir/test_excmd.vim @@ -349,6 +349,44 @@ func Test_run_excmd_with_text_locked() let cmd = ":\<C-\>eexecute('close')\<CR>\<C-C>" call assert_equal(2, winnr('$')) close + + call assert_fails("call feedkeys(\":\<C-R>=execute('bnext')\<CR>\", 'xt')", 'E523:') +endfunc + +" Test for the :verbose command +func Test_verbose_cmd() + call assert_equal([' verbose=1'], split(execute('verbose set vbs'), "\n")) + call assert_equal([' verbose=0'], split(execute('0verbose set vbs'), "\n")) + let l = execute("4verbose set verbose | set verbose") + call assert_equal([' verbose=4', ' verbose=0'], split(l, "\n")) +endfunc + +" Test for the :delete command and the related abbreviated commands +func Test_excmd_delete() + new + call setline(1, ['foo', "\tbar"]) + call assert_equal(['^Ibar$'], split(execute('dl'), "\n")) + call setline(1, ['foo', "\tbar"]) + call assert_equal(['^Ibar$'], split(execute('dell'), "\n")) + call setline(1, ['foo', "\tbar"]) + call assert_equal(['^Ibar$'], split(execute('delel'), "\n")) + call setline(1, ['foo', "\tbar"]) + call assert_equal(['^Ibar$'], split(execute('deletl'), "\n")) + call setline(1, ['foo', "\tbar"]) + call assert_equal(['^Ibar$'], split(execute('deletel'), "\n")) + call setline(1, ['foo', "\tbar"]) + call assert_equal([' bar'], split(execute('dp'), "\n")) + call setline(1, ['foo', "\tbar"]) + call assert_equal([' bar'], split(execute('dep'), "\n")) + call setline(1, ['foo', "\tbar"]) + call assert_equal([' bar'], split(execute('delp'), "\n")) + call setline(1, ['foo', "\tbar"]) + call assert_equal([' bar'], split(execute('delep'), "\n")) + call setline(1, ['foo', "\tbar"]) + call assert_equal([' bar'], split(execute('deletp'), "\n")) + call setline(1, ['foo', "\tbar"]) + call assert_equal([' bar'], split(execute('deletep'), "\n")) + close! endfunc " vim: shiftwidth=2 sts=2 expandtab |