mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.0540: regexp and other code not tested
Problem: Regexp and other code not tested. Solution: Add more tests. (Yegappan Lakshmanan, closes #5904)
This commit is contained in:
@@ -171,6 +171,10 @@ func Test_regexp_single_line_pat()
|
||||
call add(tl, [2, 'c*', 'abdef', ''])
|
||||
call add(tl, [2, 'bc\+', 'abccccdef', 'bcccc'])
|
||||
call add(tl, [2, 'bc\+', 'abdef']) " no match
|
||||
" match escape character in a string
|
||||
call add(tl, [2, '.\e.', "one\<Esc>two", "e\<Esc>t"])
|
||||
" match backspace character in a string
|
||||
call add(tl, [2, '.\b.', "one\<C-H>two", "e\<C-H>t"])
|
||||
" match newline character in a string
|
||||
call add(tl, [2, 'o\nb', "foo\nbar", "o\nb"])
|
||||
|
||||
@@ -913,6 +917,8 @@ func Test_regexp_error()
|
||||
call assert_fails("call matchlist('x x', '\\%#=2 \\zs*')", 'E888:')
|
||||
call assert_fails("call matchlist('x x', '\\%#=2 \\ze*')", 'E888:')
|
||||
call assert_fails('exe "normal /\\%#=1\\%[x\\%[x]]\<CR>"', 'E369:')
|
||||
call assert_fails("call matchstr('abcd', '\\%o841\\%o142')", 'E678:')
|
||||
call assert_equal('', matchstr('abcd', '\%o181\%o142'))
|
||||
endfunc
|
||||
|
||||
" Test for using the last substitute string pattern (~)
|
||||
|
Reference in New Issue
Block a user