0
0
mirror of https://github.com/vim/vim.git synced 2025-11-14 23:04:02 -05: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

@@ -1383,11 +1383,25 @@ func Test_sort_last_search_pat()
call setline(1, ['3b', '1c', '2a'])
sort //
call assert_equal(['2a', '3b', '1c'], getline(1, '$'))
call test_clear_search_pat()
call assert_fails('sort //', 'E35:')
close!
endfunc
" Test for :sort with no last search pattern
func Test_sort_with_no_last_search_pat()
let lines =<< trim [SCRIPT]
call setline(1, ['3b', '1c', '2a'])
call assert_fails('sort //', 'E35:')
call writefile(v:errors, 'Xresult')
qall!
[SCRIPT]
call writefile(lines, 'Xscript')
if RunVim([], [], '--clean -S Xscript')
call assert_equal([], readfile('Xresult'))
endif
call delete('Xscript')
call delete('Xresult')
endfunc
" Test for retaining marks across a :sort
func Test_sort_with_marks()
new