From d40739843cf9a160587032bf381c440079e5a8ce Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 26 Oct 2022 13:05:33 +0800 Subject: vim-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 vim/vim#5804) https://github.com/vim/vim/commit/8dfcce3a78ccb520cc9d09081f998091494c50bf Assert E475 instead of E474 in :redir test because a later patch changed the error number. Comment out the test for :echo with a deeply nested container as Nvim implements :echo very differently. --- src/nvim/testdir/test_diffmode.vim | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/nvim/testdir/test_diffmode.vim') diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim index 1cb71664bd..831efdbfc2 100644 --- a/src/nvim/testdir/test_diffmode.vim +++ b/src/nvim/testdir/test_diffmode.vim @@ -1198,6 +1198,33 @@ func Test_diff_maintains_change_mark() delfunc DiffMaintainsChangeMark 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 + func Test_diff_rnu() CheckScreendump -- cgit