comparison src/testdir/test_charsearch.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 546bdeef35f1
children d3fa0d29fa9a
comparison
equal deleted inserted replaced
20198:b68ad1b8f3a6 20199:a4bd28e2cf1d
27 normal! $;p 27 normal! $;p
28 call setcharsearch({'until': 1}) 28 call setcharsearch({'until': 1})
29 set cpo-=; 29 set cpo-=;
30 normal! ;;p 30 normal! ;;p
31 call assert_equal('ZabcdeZfghijkZZemnokqretkZvwxyz', getline(3)) 31 call assert_equal('ZabcdeZfghijkZZemnokqretkZvwxyz', getline(3))
32
33 " check that repeating a search before and after a line fails
34 normal 3Gfv
35 call assert_beeps('normal ;')
36 call assert_beeps('normal ,')
37
38 " clear the character search
39 call setcharsearch({'char' : ''})
40 call assert_equal('', getcharsearch().char)
32 41
33 call assert_fails("call setcharsearch([])", 'E715:') 42 call assert_fails("call setcharsearch([])", 'E715:')
34 enew! 43 enew!
35 endfunc 44 endfunc
36 45
73 call assert_equal([0, 1, 2, 6], getpos('.')) 82 call assert_equal([0, 1, 2, 6], getpos('.'))
74 set virtualedit& 83 set virtualedit&
75 close! 84 close!
76 endfunc 85 endfunc
77 86
87 " Test for character search failure in latin1 encoding
88 func Test_charsearch_latin1()
89 new
90 let save_enc = &encoding
91 set encoding=latin1
92 call setline(1, 'abcdefghijk')
93 call assert_beeps('normal fz')
94 call assert_beeps('normal tx')
95 call assert_beeps('normal $Fz')
96 call assert_beeps('normal $Tx')
97 let &encoding = save_enc
98 close!
99 endfunc
100
78 " vim: shiftwidth=2 sts=2 expandtab 101 " vim: shiftwidth=2 sts=2 expandtab