diff src/testdir/test_excmd.vim @ 19471:cb73f4ae6b7c v8.2.0293

patch 8.2.0293: various Ex commands not sufficiently tested Commit: https://github.com/vim/vim/commit/818fc9ad143911b2faa0d7cee86724aa70a02080 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Feb 21 17:54:45 2020 +0100 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 https://github.com/vim/vim/issues/5673)
author Bram Moolenaar <Bram@vim.org>
date Fri, 21 Feb 2020 18:00:05 +0100
parents 8f8a5a15d00a
children f70a3c1000bb
line wrap: on
line diff
--- 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