summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_charsearch.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-10-07 16:54:52 +0200
committerBram Moolenaar <Bram@vim.org>2020-10-07 16:54:52 +0200
commitd7e5e9430ae192c76f1f03c3ac53fae823d94c33 (patch)
treefea9b36f54320f3ea69a4e346aa81fcab51b42f7 /src/testdir/test_charsearch.vim
parent4e2114e988f5d8635f2ad748be3cafcc44289138 (diff)
patch 8.2.1810: some code in normal.c not covered by testsv8.2.1810
Problem: Some code in normal.c not covered by tests. Solution: Add normal mode tests. (Yegappan Lakshmanan, closes #7086)
Diffstat (limited to 'src/testdir/test_charsearch.vim')
-rw-r--r--src/testdir/test_charsearch.vim31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/testdir/test_charsearch.vim b/src/testdir/test_charsearch.vim
index 78e991d8cb..06b8ff6ce9 100644
--- a/src/testdir/test_charsearch.vim
+++ b/src/testdir/test_charsearch.vim
@@ -51,7 +51,7 @@ func Test_csearch_virtualedit()
normal! tb
call assert_equal([0, 1, 2, 6], getpos('.'))
set virtualedit&
- close!
+ bw!
endfunc
" Test for character search failure in latin1 encoding
@@ -65,7 +65,34 @@ func Test_charsearch_latin1()
call assert_beeps('normal $Fz')
call assert_beeps('normal $Tx')
let &encoding = save_enc
- close!
+ bw!
+endfunc
+
+" Test for using character search to find a multibyte character with composing
+" characters.
+func Test_charsearch_composing_char()
+ new
+ call setline(1, "one two thq\u0328\u0301r\u0328\u0301ree")
+ call feedkeys("fr\u0328\u0301", 'xt')
+ call assert_equal([0, 1, 16, 0, 12], getcurpos())
+
+ " use character search with a multi-byte character followed by a
+ " non-composing character
+ call setline(1, "abc deȉf ghi")
+ call feedkeys("ggcf\u0209\u0210", 'xt')
+ call assert_equal("\u0210f ghi", getline(1))
+ bw!
+endfunc
+
+" Test for character search with 'hkmap'
+func Test_charsearch_hkmap()
+ new
+ set hkmap
+ call setline(1, "ùðáâ÷ëòéïçìêöî")
+ call feedkeys("fë", 'xt')
+ call assert_equal([0, 1, 11, 0, 6], getcurpos())
+ set hkmap&
+ bw!
endfunc
" vim: shiftwidth=2 sts=2 expandtab