vim-patch:8.0.1153: no tests for diff_hlID() and diff_filler()

Problem:    No tests for diff_hlID() and diff_filler().
Solution:   Add tests. (Dominique Pelle, closes vim/vim#2156)
97fbc404fc
This commit is contained in:
Jan Edmund Lazo 2019-02-03 22:12:41 -05:00
parent 11f03ee3f3
commit 1782550bfe

View File

@ -672,6 +672,31 @@ func Test_diff_filler()
%bwipe!
endfunc
func Test_diff_hlID()
new
call setline(1, [1, 2, 3])
diffthis
vnew
call setline(1, ['1x', 2, 'x', 3])
diffthis
redraw
call assert_equal(synIDattr(diff_hlID(-1, 1), "name"), "")
call assert_equal(synIDattr(diff_hlID(1, 1), "name"), "DiffChange")
call assert_equal(synIDattr(diff_hlID(1, 2), "name"), "DiffText")
call assert_equal(synIDattr(diff_hlID(2, 1), "name"), "")
call assert_equal(synIDattr(diff_hlID(3, 1), "name"), "DiffAdd")
call assert_equal(synIDattr(diff_hlID(4, 1), "name"), "")
wincmd w
call assert_equal(synIDattr(diff_hlID(1, 1), "name"), "DiffChange")
call assert_equal(synIDattr(diff_hlID(2, 1), "name"), "")
call assert_equal(synIDattr(diff_hlID(3, 1), "name"), "")
%bwipe!
endfunc
func Test_diff_lastline()
enew!
only!