]> granicus.if.org Git - vim/commitdiff
patch 7.4.2126 v7.4.2126
authorBram Moolenaar <Bram@vim.org>
Sat, 30 Jul 2016 17:11:25 +0000 (19:11 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 30 Jul 2016 17:11:25 +0000 (19:11 +0200)
Problem:    No tests for :diffget and :diffput
Solution:   Add tests.

src/testdir/test_diffmode.vim
src/version.c

index 39376bdabf70de0dd559d3bc69230204f4e4402f..766659486268c7ba6ab8003a8e53f37478296bf2 100644 (file)
@@ -162,6 +162,43 @@ func Test_filler_lines()
   wincmd h
   call assert_equal(1, line('w0'))
   unlet! diff_fdm diff_fdc
+  windo diffoff
+  bwipe!
+  enew!
+endfunc
 
-  windo bw!
+func Test_diffget_diffput()
+  enew!
+  let l = range(50)
+  call setline(1, l)
+  call assert_fails('diffget', 'E99:')
+  diffthis
+  call assert_fails('diffget', 'E100:')
+  new
+  let l[10] = 'one'
+  let l[20] = 'two'
+  let l[30] = 'three'
+  let l[40] = 'four'
+  call setline(1, l)
+  diffthis
+  call assert_equal('one', getline(11))
+  11diffget
+  call assert_equal('10', getline(11))
+  21diffput
+  wincmd w
+  call assert_equal('two', getline(21))
+  normal 31Gdo
+  call assert_equal('three', getline(31))
+  call assert_equal('40', getline(41))
+  normal 41Gdp
+  wincmd w
+  call assert_equal('40', getline(41))
+  new
+  diffthis
+  call assert_fails('diffget', 'E101:')
+
+  windo diffoff
+  bwipe!
+  bwipe!
+  enew!
 endfunc
index 429dda03fa426cbc405cdd0cdc90653243bda797..f456729f526b03aa001e58f6b1166ccc949a5706 100644 (file)
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2126,
 /**/
     2125,
 /**/