patch 8.2.0655: search code not sufficiently tested
Problem: Search code not sufficiently tested.
Solution: Add more tests. (Yegappan Lakshmanan, closes #5999)
diff --git a/src/testdir/test_gn.vim b/src/testdir/test_gn.vim
index 098fc3d..c72da92 100644
--- a/src/testdir/test_gn.vim
+++ b/src/testdir/test_gn.vim
@@ -154,8 +154,24 @@
norm! gg0f2vf7gNd
call assert_equal(['1678'], getline(1,'$'))
sil! %d _
-
set wrapscan&vim
+
+ " Without 'wrapscan', in visual mode, running gn without a match should fail
+ " but the visual mode should be kept.
+ set nowrapscan
+ call setline('.', 'one two')
+ let @/ = 'one'
+ call assert_beeps('normal 0wvlgn')
+ exe "normal y"
+ call assert_equal('tw', @")
+
+ " with exclusive selection, run gn and gN
+ set selection=exclusive
+ normal 0gny
+ call assert_equal('one', @")
+ normal 0wgNy
+ call assert_equal('one', @")
+ set selection&
endfu
func Test_gn_multi_line()