comparison 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
comparison
equal deleted inserted replaced
19470:ddc2e7caff46 19471:cb73f4ae6b7c
347 " :close - should be ignored 347 " :close - should be ignored
348 new 348 new
349 let cmd = ":\<C-\>eexecute('close')\<CR>\<C-C>" 349 let cmd = ":\<C-\>eexecute('close')\<CR>\<C-C>"
350 call assert_equal(2, winnr('$')) 350 call assert_equal(2, winnr('$'))
351 close 351 close
352
353 call assert_fails("call feedkeys(\":\<C-R>=execute('bnext')\<CR>\", 'xt')", 'E523:')
354 endfunc
355
356 " Test for the :verbose command
357 func Test_verbose_cmd()
358 call assert_equal([' verbose=1'], split(execute('verbose set vbs'), "\n"))
359 call assert_equal([' verbose=0'], split(execute('0verbose set vbs'), "\n"))
360 let l = execute("4verbose set verbose | set verbose")
361 call assert_equal([' verbose=4', ' verbose=0'], split(l, "\n"))
362 endfunc
363
364 " Test for the :delete command and the related abbreviated commands
365 func Test_excmd_delete()
366 new
367 call setline(1, ['foo', "\tbar"])
368 call assert_equal(['^Ibar$'], split(execute('dl'), "\n"))
369 call setline(1, ['foo', "\tbar"])
370 call assert_equal(['^Ibar$'], split(execute('dell'), "\n"))
371 call setline(1, ['foo', "\tbar"])
372 call assert_equal(['^Ibar$'], split(execute('delel'), "\n"))
373 call setline(1, ['foo', "\tbar"])
374 call assert_equal(['^Ibar$'], split(execute('deletl'), "\n"))
375 call setline(1, ['foo', "\tbar"])
376 call assert_equal(['^Ibar$'], split(execute('deletel'), "\n"))
377 call setline(1, ['foo', "\tbar"])
378 call assert_equal([' bar'], split(execute('dp'), "\n"))
379 call setline(1, ['foo', "\tbar"])
380 call assert_equal([' bar'], split(execute('dep'), "\n"))
381 call setline(1, ['foo', "\tbar"])
382 call assert_equal([' bar'], split(execute('delp'), "\n"))
383 call setline(1, ['foo', "\tbar"])
384 call assert_equal([' bar'], split(execute('delep'), "\n"))
385 call setline(1, ['foo', "\tbar"])
386 call assert_equal([' bar'], split(execute('deletp'), "\n"))
387 call setline(1, ['foo', "\tbar"])
388 call assert_equal([' bar'], split(execute('deletep'), "\n"))
389 close!
352 endfunc 390 endfunc
353 391
354 " vim: shiftwidth=2 sts=2 expandtab 392 " vim: shiftwidth=2 sts=2 expandtab