diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2018-01-15 22:42:52 +0100 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2018-01-15 22:42:52 +0100 |
| commit | 726197d8907891eda99299a2920b0d1d98148a3c (patch) | |
| tree | 4345e1beaa8e9f5856bf1278679dfb8b22da044f /src/nvim/testdir/test_diffmode.vim | |
| parent | f09a30d5b0abb8f12d2e6a10cebaf87ca11aa135 (diff) | |
| parent | b9f3805447f9e0ff277aa655dfb9513f41db5ce6 (diff) | |
| download | rneovim-726197d8907891eda99299a2920b0d1d98148a3c.tar.gz rneovim-726197d8907891eda99299a2920b0d1d98148a3c.tar.bz2 rneovim-726197d8907891eda99299a2920b0d1d98148a3c.zip | |
Merge #7850 'vim patches'
Diffstat (limited to 'src/nvim/testdir/test_diffmode.vim')
| -rw-r--r-- | src/nvim/testdir/test_diffmode.vim | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim index 88f73cdb5b..33617c9cbe 100644 --- a/src/nvim/testdir/test_diffmode.vim +++ b/src/nvim/testdir/test_diffmode.vim @@ -273,6 +273,81 @@ func Test_setting_cursor() call delete('Xtest2') endfunc +func Test_diff_move_to() + new + call setline(1, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) + diffthis + vnew + call setline(1, [1, '2x', 3, 4, 4, 5, '6x', 7, '8x', 9, '10x']) + diffthis + norm ]c + call assert_equal(2, line('.')) + norm 3]c + call assert_equal(9, line('.')) + norm 10]c + call assert_equal(11, line('.')) + norm [c + call assert_equal(9, line('.')) + norm 2[c + call assert_equal(5, line('.')) + norm 10[c + call assert_equal(2, line('.')) + %bwipe! +endfunc + +func Test_diffpatch() + " The patch program on MS-Windows may fail or hang. + if !executable('patch') || !has('unix') + return + endif + new + insert +*************** +*** 1,3 **** + 1 +! 2 + 3 +--- 1,4 ---- + 1 +! 2x + 3 ++ 4 +. + saveas Xpatch + bwipe! + new + call assert_fails('diffpatch Xpatch', 'E816:') + call setline(1, ['1', '2', '3']) + diffpatch Xpatch + call assert_equal(['1', '2x', '3', '4'], getline(1, '$')) + call delete('Xpatch') + bwipe! +endfunc + +func Test_diff_too_many_buffers() + for i in range(1, 8) + exe "new Xtest" . i + diffthis + endfor + new Xtest9 + call assert_fails('diffthis', 'E96:') + %bwipe! +endfunc + +func Test_diff_nomodifiable() + new + call setline(1, [1, 2, 3, 4]) + setl nomodifiable + diffthis + vnew + call setline(1, ['1x', 2, 3, 3, 4]) + diffthis + call assert_fails('norm dp', 'E793:') + setl nomodifiable + call assert_fails('norm do', 'E21:') + %bwipe! +endfunc + func Test_diff_lastline() enew! only! |