From e53330a603fc95b3b00af98bce56982627851641 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 17 Jul 2022 09:23:49 +0800 Subject: vim-patch:8.2.0655: search code not sufficiently tested Problem: Search code not sufficiently tested. Solution: Add more tests. (Yegappan Lakshmanan, closes vim/vim#5999) https://github.com/vim/vim/commit/224a5f17c6ec9e98322a4c6792ce4f9bb31a4cce Cherry-pick test_charsearch.vim change from patch 8.2.0448. Cherry-pick test_search.vim changes from patch 8.2.0619. --- src/nvim/testdir/test_textformat.vim | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir/test_textformat.vim') diff --git a/src/nvim/testdir/test_textformat.vim b/src/nvim/testdir/test_textformat.vim index f0a0f894c3..35a7887761 100644 --- a/src/nvim/testdir/test_textformat.vim +++ b/src/nvim/testdir/test_textformat.vim @@ -1060,7 +1060,7 @@ func Test_tw_2_fo_tm_replace() endfunc " Test for 'matchpairs' with multibyte chars -func Test_mps() +func Test_mps_multibyte() new let t =<< trim END { @@ -1084,6 +1084,30 @@ func Test_mps() bwipe! endfunc +" Test for 'matchpairs' in latin1 encoding +func Test_mps_latin1() + new + let save_enc = &encoding + " set encoding=latin1 + call setline(1, 'abc(def)ghi') + normal % + call assert_equal(8, col('.')) + normal % + call assert_equal(4, col('.')) + call cursor(1, 6) + normal [( + call assert_equal(4, col('.')) + normal % + call assert_equal(8, col('.')) + call cursor(1, 6) + normal ]) + call assert_equal(8, col('.')) + normal % + call assert_equal(4, col('.')) + let &encoding = save_enc + close! +endfunc + func Test_empty_matchpairs() split set matchpairs= showmatch -- cgit