comparison src/testdir/test_gn.vim @ 20199:a4bd28e2cf1d v8.2.0655

patch 8.2.0655: search code not sufficiently tested Commit: https://github.com/vim/vim/commit/224a5f17c6ec9e98322a4c6792ce4f9bb31a4cce Author: Bram Moolenaar <Bram@vim.org> Date: Tue Apr 28 20:29:07 2020 +0200 patch 8.2.0655: search code not sufficiently tested Problem: Search code not sufficiently tested. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5999)
author Bram Moolenaar <Bram@vim.org>
date Tue, 28 Apr 2020 20:30:04 +0200
parents c0445cb7cfe0
children cbc570e66d11
comparison
equal deleted inserted replaced
20198:b68ad1b8f3a6 20199:a4bd28e2cf1d
152 call setline('.', ['12345678']) 152 call setline('.', ['12345678'])
153 let @/ = '5' 153 let @/ = '5'
154 norm! gg0f2vf7gNd 154 norm! gg0f2vf7gNd
155 call assert_equal(['1678'], getline(1,'$')) 155 call assert_equal(['1678'], getline(1,'$'))
156 sil! %d _ 156 sil! %d _
157 set wrapscan&vim
157 158
158 set wrapscan&vim 159 " Without 'wrapscan', in visual mode, running gn without a match should fail
160 " but the visual mode should be kept.
161 set nowrapscan
162 call setline('.', 'one two')
163 let @/ = 'one'
164 call assert_beeps('normal 0wvlgn')
165 exe "normal y"
166 call assert_equal('tw', @")
167
168 " with exclusive selection, run gn and gN
169 set selection=exclusive
170 normal 0gny
171 call assert_equal('one', @")
172 normal 0wgNy
173 call assert_equal('one', @")
174 set selection&
159 endfu 175 endfu
160 176
161 func Test_gn_multi_line() 177 func Test_gn_multi_line()
162 new 178 new
163 call setline(1, [ 179 call setline(1, [