comparison src/testdir/test_regexp_latin.vim @ 19969:b07672d13ff9 v8.2.0540

patch 8.2.0540: regexp and other code not tested Commit: https://github.com/vim/vim/commit/004a6781b3cf15ca5dd632c38cc09bb3b253d1f8 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 11 17:09:31 2020 +0200 patch 8.2.0540: regexp and other code not tested Problem: Regexp and other code not tested. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5904)
author Bram Moolenaar <Bram@vim.org>
date Sat, 11 Apr 2020 17:15:06 +0200
parents 0b42b5e50344
children 6a4806e326dd
comparison
equal deleted inserted replaced
19968:1908e92b02fd 19969:b07672d13ff9
169 call add(tl, [2, 'c*', 'ccc', 'ccc']) 169 call add(tl, [2, 'c*', 'ccc', 'ccc'])
170 call add(tl, [2, 'bc*', 'abdef', 'b']) 170 call add(tl, [2, 'bc*', 'abdef', 'b'])
171 call add(tl, [2, 'c*', 'abdef', '']) 171 call add(tl, [2, 'c*', 'abdef', ''])
172 call add(tl, [2, 'bc\+', 'abccccdef', 'bcccc']) 172 call add(tl, [2, 'bc\+', 'abccccdef', 'bcccc'])
173 call add(tl, [2, 'bc\+', 'abdef']) " no match 173 call add(tl, [2, 'bc\+', 'abdef']) " no match
174 " match escape character in a string
175 call add(tl, [2, '.\e.', "one\<Esc>two", "e\<Esc>t"])
176 " match backspace character in a string
177 call add(tl, [2, '.\b.', "one\<C-H>two", "e\<C-H>t"])
174 " match newline character in a string 178 " match newline character in a string
175 call add(tl, [2, 'o\nb', "foo\nbar", "o\nb"]) 179 call add(tl, [2, 'o\nb', "foo\nbar", "o\nb"])
176 180
177 " operator \| 181 " operator \|
178 call add(tl, [2, 'a\|ab', 'cabd', 'a']) " alternation is ordered 182 call add(tl, [2, 'a\|ab', 'cabd', 'a']) " alternation is ordered
911 call assert_fails("call matchlist('x x', '\\%#=1 \\zs*')", 'E888:') 915 call assert_fails("call matchlist('x x', '\\%#=1 \\zs*')", 'E888:')
912 call assert_fails("call matchlist('x x', '\\%#=1 \\ze*')", 'E888:') 916 call assert_fails("call matchlist('x x', '\\%#=1 \\ze*')", 'E888:')
913 call assert_fails("call matchlist('x x', '\\%#=2 \\zs*')", 'E888:') 917 call assert_fails("call matchlist('x x', '\\%#=2 \\zs*')", 'E888:')
914 call assert_fails("call matchlist('x x', '\\%#=2 \\ze*')", 'E888:') 918 call assert_fails("call matchlist('x x', '\\%#=2 \\ze*')", 'E888:')
915 call assert_fails('exe "normal /\\%#=1\\%[x\\%[x]]\<CR>"', 'E369:') 919 call assert_fails('exe "normal /\\%#=1\\%[x\\%[x]]\<CR>"', 'E369:')
920 call assert_fails("call matchstr('abcd', '\\%o841\\%o142')", 'E678:')
921 call assert_equal('', matchstr('abcd', '\%o181\%o142'))
916 endfunc 922 endfunc
917 923
918 " Test for using the last substitute string pattern (~) 924 " Test for using the last substitute string pattern (~)
919 func Test_regexp_last_subst_string() 925 func Test_regexp_last_subst_string()
920 new 926 new