Skip to content

Commit 90d121f

Browse files
committed
patch 7.4.2126
Problem: No tests for :diffget and :diffput Solution: Add tests.
1 parent b20617b commit 90d121f

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

src/testdir/test_diffmode.vim

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,43 @@ func Test_filler_lines()
162162
wincmd h
163163
call assert_equal(1, line('w0'))
164164
unlet! diff_fdm diff_fdc
165+
windo diffoff
166+
bwipe!
167+
enew!
168+
endfunc
165169

166-
windo bw!
170+
func Test_diffget_diffput()
171+
enew!
172+
let l = range(50)
173+
call setline(1, l)
174+
call assert_fails('diffget', 'E99:')
175+
diffthis
176+
call assert_fails('diffget', 'E100:')
177+
new
178+
let l[10] = 'one'
179+
let l[20] = 'two'
180+
let l[30] = 'three'
181+
let l[40] = 'four'
182+
call setline(1, l)
183+
diffthis
184+
call assert_equal('one', getline(11))
185+
11diffget
186+
call assert_equal('10', getline(11))
187+
21diffput
188+
wincmd w
189+
call assert_equal('two', getline(21))
190+
normal 31Gdo
191+
call assert_equal('three', getline(31))
192+
call assert_equal('40', getline(41))
193+
normal 41Gdp
194+
wincmd w
195+
call assert_equal('40', getline(41))
196+
new
197+
diffthis
198+
call assert_fails('diffget', 'E101:')
199+
200+
windo diffoff
201+
bwipe!
202+
bwipe!
203+
enew!
167204
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2126,
766768
/**/
767769
2125,
768770
/**/

0 commit comments

Comments
 (0)