diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-02-03 22:12:41 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-03-31 08:31:38 -0400 |
commit | 1782550bfe6796303a893fa7c2a5675e0e383129 (patch) | |
tree | 185037f7e488961def4ca8d07a7af466396bc3a7 | |
parent | 11f03ee3f3da623440607220b8167a3b797d9daa (diff) | |
download | rneovim-1782550bfe6796303a893fa7c2a5675e0e383129.tar.gz rneovim-1782550bfe6796303a893fa7c2a5675e0e383129.tar.bz2 rneovim-1782550bfe6796303a893fa7c2a5675e0e383129.zip |
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)
https://github.com/vim/vim/commit/97fbc404fc56f76df12b2d2658b1d6efda28d5dd
-rw-r--r-- | src/nvim/testdir/test_diffmode.vim | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim index ad3eec3274..c3c3fb1f63 100644 --- a/src/nvim/testdir/test_diffmode.vim +++ b/src/nvim/testdir/test_diffmode.vim @@ -527,7 +527,7 @@ func Test_setting_cursor() new Xtest2 put =range(1,100) wq - + tabe Xtest2 $ diffsp Xtest1 @@ -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! |