summaryrefslogtreecommitdiff
path: root/src/testdir/test_regexp_latin.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-11 17:09:31 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-11 17:09:31 +0200
commit004a6781b3cf15ca5dd632c38cc09bb3b253d1f8 (patch)
tree7f71edb5284a22ff7e24b638303e0f5c1f5988d6 /src/testdir/test_regexp_latin.vim
parentd1caa941d876181aae0ebebc6ea954045bf0da24 (diff)
downloadvim-git-004a6781b3cf15ca5dd632c38cc09bb3b253d1f8.tar.gz
patch 8.2.0540: regexp and other code not testedv8.2.0540
Problem: Regexp and other code not tested. Solution: Add more tests. (Yegappan Lakshmanan, closes #5904)
Diffstat (limited to 'src/testdir/test_regexp_latin.vim')
-rw-r--r--src/testdir/test_regexp_latin.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/testdir/test_regexp_latin.vim b/src/testdir/test_regexp_latin.vim
index f2910f064..15ab84c46 100644
--- a/src/testdir/test_regexp_latin.vim
+++ b/src/testdir/test_regexp_latin.vim
@@ -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 (~)