comparison src/testdir/test_search.vim @ 11105:7c7e496e625d v8.0.0440

patch 8.0.0440: not enough test coverage in Insert mode commit https://github.com/vim/vim/commit/eb992cb90fd79c77ad2743459ac898e6ac3de939 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 9 18:20:16 2017 +0100 patch 8.0.0440: not enough test coverage in Insert mode Problem: Not enough test coverage in Insert mode. Solution: Add lots of tests. Add test_override(). (Christian Brabandt, closes #1521)
author Christian Brabandt <cb@256bit.org>
date Thu, 09 Mar 2017 18:30:07 +0100
parents ae45d497868f
children 7428a08c2f68
comparison
equal deleted inserted replaced
11104:c6f6c6262418 11105:7c7e496e625d
5 if !exists('+incsearch') 5 if !exists('+incsearch')
6 return 6 return
7 endif 7 endif
8 " need to disable char_avail, 8 " need to disable char_avail,
9 " so that expansion of commandline works 9 " so that expansion of commandline works
10 call test_disable_char_avail(1) 10 call test_override("char_avail", 1)
11 new 11 new
12 call setline(1, [' 1', ' 2 these', ' 3 the', ' 4 their', ' 5 there', ' 6 their', ' 7 the', ' 8 them', ' 9 these', ' 10 foobar']) 12 call setline(1, [' 1', ' 2 these', ' 3 the', ' 4 their', ' 5 there', ' 6 their', ' 7 the', ' 8 them', ' 9 these', ' 10 foobar'])
13 " Test 1 13 " Test 1
14 " CTRL-N / CTRL-P skips through the previous search history 14 " CTRL-N / CTRL-P skips through the previous search history
15 set noincsearch 15 set noincsearch
192 " delete all chars, start from the beginning again 192 " delete all chars, start from the beginning again
193 call feedkeys("/them". repeat("\<bs>",4).'the\>'."\<cr>", 'tx') 193 call feedkeys("/them". repeat("\<bs>",4).'the\>'."\<cr>", 'tx')
194 call assert_equal(' 3 the', getline('.')) 194 call assert_equal(' 3 the', getline('.'))
195 195
196 " clean up 196 " clean up
197 call test_disable_char_avail(0) 197 call test_override("char_avail", 0)
198 bw! 198 bw!
199 endfunc 199 endfunc
200 200
201 func Test_search_cmdline2() 201 func Test_search_cmdline2()
202 if !exists('+incsearch') 202 if !exists('+incsearch')
203 return 203 return
204 endif 204 endif
205 " need to disable char_avail, 205 " need to disable char_avail,
206 " so that expansion of commandline works 206 " so that expansion of commandline works
207 call test_disable_char_avail(1) 207 call test_override("char_avail", 1)
208 new 208 new
209 call setline(1, [' 1', ' 2 these', ' 3 the theother']) 209 call setline(1, [' 1', ' 2 these', ' 3 the theother'])
210 " Test 1 210 " Test 1
211 " Ctrl-T goes correctly back and forth 211 " Ctrl-T goes correctly back and forth
212 set incsearch 212 set incsearch
264 "call assert_fails(feedkeys("/foo\<c-w>\<cr>", 'tx'), 'E35') 264 "call assert_fails(feedkeys("/foo\<c-w>\<cr>", 'tx'), 'E35')
265 "call assert_equal({'lnum': 1, 'leftcol': 0, 'col': 0, 'topfill': 0, 'topline': 1, 'coladd': 0, 'skipcol': 0, 'curswant': 0}, winsaveview()) 265 "call assert_equal({'lnum': 1, 'leftcol': 0, 'col': 0, 'topfill': 0, 'topline': 1, 'coladd': 0, 'skipcol': 0, 'curswant': 0}, winsaveview())
266 266
267 " clean up 267 " clean up
268 set noincsearch 268 set noincsearch
269 call test_disable_char_avail(0) 269 call test_override("char_avail", 0)
270 bw! 270 bw!
271 endfunc 271 endfunc
272 272
273 func Test_use_sub_pat() 273 func Test_use_sub_pat()
274 split 274 split