diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-03-18 19:32:26 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-03-18 19:32:26 +0100 |
commit | 8dfcce3a78ccb520cc9d09081f998091494c50bf (patch) | |
tree | 7e3412f192510c58f5a435ee66eab1d34606cdc0 /src/testdir/test_diffmode.vim | |
parent | 3cdcb090a664e182078f7cc0ca3e4e5a94bbb784 (diff) |
patch 8.2.0401: not enough test coverage for evalvars.cv8.2.0401
Problem: Not enough test coverage for evalvars.c.
Solution: Add more tests. (Yegappan Lakshmanan, closes #5804)
Diffstat (limited to 'src/testdir/test_diffmode.vim')
-rw-r--r-- | src/testdir/test_diffmode.vim | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim index d1160d09ff..07aa919f4c 100644 --- a/src/testdir/test_diffmode.vim +++ b/src/testdir/test_diffmode.vim @@ -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 |