0
0
mirror of https://github.com/vim/vim.git synced 2025-10-09 06:14:17 -04:00

patch 8.2.0243: insufficient code coverage for ex_docmd.c functions

Problem:    Insufficient code coverage for ex_docmd.c functions.
Solution:   Add more tests. (Yegappan Lakshmanan, closes #5618)
This commit is contained in:
Bram Moolenaar
2020-02-11 22:04:02 +01:00
parent 799439a5d8
commit 9f6277bdde
17 changed files with 399 additions and 46 deletions

View File

@@ -84,4 +84,26 @@ func Test_Ex_substitute()
call StopVimInTerminal(buf)
endfunc
" Test for displaying lines from an empty buffer in Ex mode
func Test_Ex_emptybuf()
new
call assert_fails('call feedkeys("Q\<CR>", "xt")', 'E749:')
call setline(1, "abc")
call assert_fails('call feedkeys("Q\<CR>", "xt")', 'E501:')
call assert_fails('call feedkeys("Q%d\<CR>", "xt")', 'E749:')
close!
endfunc
" Test for the :open command
func Test_open_command()
new
call setline(1, ['foo foo', 'foo bar', 'foo baz'])
call feedkeys("Qopen\<CR>j", 'xt')
call assert_equal('foo bar', getline('.'))
call feedkeys("Qopen /bar/\<CR>", 'xt')
call assert_equal(5, col('.'))
call assert_fails('call feedkeys("Qopen /baz/\<CR>", "xt")', 'E479:')
close!
endfunc
" vim: shiftwidth=2 sts=2 expandtab