aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_charsearch.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_charsearch.vim')
-rw-r--r--src/nvim/testdir/test_charsearch.vim25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_charsearch.vim b/src/nvim/testdir/test_charsearch.vim
index 683bcabe34..d386d74f8d 100644
--- a/src/nvim/testdir/test_charsearch.vim
+++ b/src/nvim/testdir/test_charsearch.vim
@@ -29,6 +29,17 @@ func Test_charsearch()
set cpo-=;
normal! ;;p
call assert_equal('ZabcdeZfghijkZZemnokqretkZvwxyz', getline(3))
+
+ " check that repeating a search before and after a line fails
+ normal 3Gfv
+ call assert_beeps('normal ;')
+ call assert_beeps('normal ,')
+
+ " clear the character search
+ call setcharsearch({'char' : ''})
+ call assert_equal('', getcharsearch().char)
+
+ call assert_fails("call setcharsearch([])", 'E715:')
enew!
endfunc
@@ -73,4 +84,18 @@ func Test_csearch_virtualedit()
close!
endfunc
+" Test for character search failure in latin1 encoding
+func Test_charsearch_latin1()
+ new
+ let save_enc = &encoding
+ " set encoding=latin1
+ call setline(1, 'abcdefghijk')
+ call assert_beeps('normal fz')
+ call assert_beeps('normal tx')
+ call assert_beeps('normal $Fz')
+ call assert_beeps('normal $Tx')
+ let &encoding = save_enc
+ close!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab