mirror of
https://github.com/vim/vim.git
synced 2025-10-03 05:14:07 -04:00
patch 8.2.0401: not enough test coverage for evalvars.c
Problem: Not enough test coverage for evalvars.c. Solution: Add more tests. (Yegappan Lakshmanan, closes #5804)
This commit is contained in:
@@ -1065,3 +1065,32 @@ func Test_diff_maintains_change_mark()
|
||||
bwipe!
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for 'patchexpr'
|
||||
func Test_patchexpr()
|
||||
let g:patch_args = []
|
||||
func TPatch()
|
||||
call add(g:patch_args, readfile(v:fname_in))
|
||||
call add(g:patch_args, readfile(v:fname_diff))
|
||||
call writefile(['output file'], v:fname_out)
|
||||
endfunc
|
||||
set patchexpr=TPatch()
|
||||
|
||||
call writefile(['input file'], 'Xinput')
|
||||
call writefile(['diff file'], 'Xdiff')
|
||||
%bwipe!
|
||||
edit Xinput
|
||||
diffpatch Xdiff
|
||||
call assert_equal('output file', getline(1))
|
||||
call assert_equal('Xinput.new', bufname())
|
||||
call assert_equal(2, winnr('$'))
|
||||
call assert_true(&diff)
|
||||
|
||||
call delete('Xinput')
|
||||
call delete('Xdiff')
|
||||
set patchexpr&
|
||||
delfunc TPatch
|
||||
%bwipe!
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
Reference in New Issue
Block a user