Mercurial > vim
changeset 18898:ad9e9e92ad55 v8.2.0010
patch 8.2.0010: test64 is old style
Commit: https://github.com/vim/vim/commit/f9cb05c14753d984f002c0c090688f8510147e6b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Dec 15 13:39:22 2019 +0100
patch 8.2.0010: test64 is old style
Problem: Test64 is old style.
Solution: Convert to new style test. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5363)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 15 Dec 2019 13:45:04 +0100 |
parents | e96a45cb70d2 |
children | 17e4941b37d6 |
files | src/Makefile src/testdir/Make_all.mak src/testdir/Make_vms.mms src/testdir/test64.in src/testdir/test64.ok src/testdir/test95.in src/testdir/test_regexp_latin.vim src/version.c |
diffstat | 8 files changed, 671 insertions(+), 1765 deletions(-) [+] |
line wrap: on
line diff
--- a/src/Makefile +++ b/src/Makefile @@ -2255,7 +2255,7 @@ test1 \ test_eval \ test42 test44 test49 \ test52 test59 \ - test64 test69 \ + test69 \ test70 \ test86 test87 \ test95 test99:
--- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -15,7 +15,6 @@ SCRIPTS_FIRST = \ SCRIPTS_ALL = \ test42.out \ test44.out \ - test64.out \ test69.out \ test70.out \ test95.out \
--- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -75,7 +75,7 @@ VIMPROG = <->vim.exe SCRIPT = test1.out \ test42.out test44.out test49.out \ - test64.out test69.out \ + test69.out \ test77a.out \ test95.out test99.out \ test_eval.out
deleted file mode 100644 --- a/src/testdir/test64.in +++ /dev/null @@ -1,654 +0,0 @@ -Test for regexp patterns without multi-byte support. -See test95 for multi-byte tests. - -A pattern that gives the expected result produces OK, so that we know it was -actually tried. - -STARTTEST -:so small.vim -:" tl is a List of Lists with: -:" regexp engine -:" regexp pattern -:" text to test the pattern on -:" expected match (optional) -:" expected submatch 1 (optional) -:" expected submatch 2 (optional) -:" etc. -:" When there is no match use only the first two items. -:let tl = [] -:" -:"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -:"""" Previously written tests """""""""""""""""""""""""""""""" -:"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -:" -:call add(tl, [2, 'ab', 'aab', 'ab']) -:call add(tl, [2, 'b', 'abcdef', 'b']) -:call add(tl, [2, 'bc*', 'abccccdef', 'bcccc']) -:call add(tl, [2, 'bc\{-}', 'abccccdef', 'b']) -:call add(tl, [2, 'bc\{-}\(d\)', 'abccccdef', 'bccccd', 'd']) -:call add(tl, [2, 'bc*', 'abbdef', 'b']) -:call add(tl, [2, 'c*', 'ccc', 'ccc']) -:call add(tl, [2, 'bc*', 'abdef', 'b']) -:call add(tl, [2, 'c*', 'abdef', '']) -:call add(tl, [2, 'bc\+', 'abccccdef', 'bcccc']) -:call add(tl, [2, 'bc\+', 'abdef']) "no match -:" -:"operator \| -:call add(tl, [2, 'a\|ab', 'cabd', 'a']) "alternation is ordered -:" -:call add(tl, [2, 'c\?', 'ccb', 'c']) -:call add(tl, [2, 'bc\?', 'abd', 'b']) -:call add(tl, [2, 'bc\?', 'abccd', 'bc']) -:" -:call add(tl, [2, '\va{1}', 'ab', 'a']) -:" -:call add(tl, [2, '\va{2}', 'aa', 'aa']) -:call add(tl, [2, '\va{2}', 'caad', 'aa']) -:call add(tl, [2, '\va{2}', 'aba']) -:call add(tl, [2, '\va{2}', 'ab']) -:call add(tl, [2, '\va{2}', 'abaa', 'aa']) -:call add(tl, [2, '\va{2}', 'aaa', 'aa']) -:" -:call add(tl, [2, '\vb{1}', 'abca', 'b']) -:call add(tl, [2, '\vba{2}', 'abaa', 'baa']) -:call add(tl, [2, '\vba{3}', 'aabaac']) -:" -:call add(tl, [2, '\v(ab){1}', 'ab', 'ab', 'ab']) -:call add(tl, [2, '\v(ab){1}', 'dabc', 'ab', 'ab']) -:call add(tl, [2, '\v(ab){1}', 'acb']) -:" -:call add(tl, [2, '\v(ab){0,2}', 'acb', "", ""]) -:call add(tl, [2, '\v(ab){0,2}', 'ab', 'ab', 'ab']) -:call add(tl, [2, '\v(ab){1,2}', 'ab', 'ab', 'ab']) -:call add(tl, [2, '\v(ab){1,2}', 'ababc', 'abab', 'ab']) -:call add(tl, [2, '\v(ab){2,4}', 'ababcab', 'abab', 'ab']) -:call add(tl, [2, '\v(ab){2,4}', 'abcababa', 'abab', 'ab']) -:" -:call add(tl, [2, '\v(ab){2}', 'abab', 'abab', 'ab']) -:call add(tl, [2, '\v(ab){2}', 'cdababe', 'abab', 'ab']) -:call add(tl, [2, '\v(ab){2}', 'abac']) -:call add(tl, [2, '\v(ab){2}', 'abacabab', 'abab', 'ab']) -:call add(tl, [2, '\v((ab){2}){2}', 'abababab', 'abababab', 'abab', 'ab']) -:call add(tl, [2, '\v((ab){2}){2}', 'abacabababab', 'abababab', 'abab', 'ab']) -:" -:call add(tl, [2, '\v(a{1}){1}', 'a', 'a', 'a']) -:call add(tl, [2, '\v(a{2}){1}', 'aa', 'aa', 'aa']) -:call add(tl, [2, '\v(a{2}){1}', 'aaac', 'aa', 'aa']) -:call add(tl, [2, '\v(a{2}){1}', 'daaac', 'aa', 'aa']) -:call add(tl, [2, '\v(a{1}){2}', 'daaac', 'aa', 'a']) -:call add(tl, [2, '\v(a{1}){2}', 'aaa', 'aa', 'a']) -:call add(tl, [2, '\v(a{2})+', 'adaac', 'aa', 'aa']) -:call add(tl, [2, '\v(a{2})+', 'aa', 'aa', 'aa']) -:call add(tl, [2, '\v(a{2}){1}', 'aa', 'aa', 'aa']) -:call add(tl, [2, '\v(a{1}){2}', 'aa', 'aa', 'a']) -:call add(tl, [2, '\v(a{1}){1}', 'a', 'a', 'a']) -:call add(tl, [2, '\v(a{2}){2}', 'aaaa', 'aaaa', 'aa']) -:call add(tl, [2, '\v(a{2}){2}', 'aaabaaaa', 'aaaa', 'aa']) -:" -:call add(tl, [2, '\v(a+){2}', 'dadaac', 'aa', 'a']) -:call add(tl, [2, '\v(a{3}){2}', 'aaaaaaa', 'aaaaaa', 'aaa']) -:" -:call add(tl, [2, '\v(a{1,2}){2}', 'daaac', 'aaa', 'a']) -:call add(tl, [2, '\v(a{1,3}){2}', 'daaaac', 'aaaa', 'a']) -:call add(tl, [2, '\v(a{1,3}){2}', 'daaaaac', 'aaaaa', 'aa']) -:call add(tl, [2, '\v(a{1,3}){3}', 'daac']) -:call add(tl, [2, '\v(a{1,2}){2}', 'dac']) -:call add(tl, [2, '\v(a+)+', 'daac', 'aa', 'aa']) -:call add(tl, [2, '\v(a+)+', 'aaa', 'aaa', 'aaa']) -:call add(tl, [2, '\v(a+){1,2}', 'aaa', 'aaa', 'aaa']) -:call add(tl, [2, '\v(a+)(a+)', 'aaa', 'aaa', 'aa', 'a']) -:call add(tl, [2, '\v(a{3})+', 'daaaac', 'aaa', 'aaa']) -:call add(tl, [2, '\v(a|b|c)+', 'aacb', 'aacb', 'b']) -:call add(tl, [2, '\v(a|b|c){2}', 'abcb', 'ab', 'b']) -:call add(tl, [2, '\v(abc){2}', 'abcabd', ]) -:call add(tl, [2, '\v(abc){2}', 'abdabcabc','abcabc', 'abc']) -:" -:call add(tl, [2, 'a*', 'cc', '']) -:call add(tl, [2, '\v(a*)+', 'cc', '']) -:call add(tl, [2, '\v((ab)+)+', 'ab', 'ab', 'ab', 'ab']) -:call add(tl, [2, '\v(((ab)+)+)+', 'ab', 'ab', 'ab', 'ab', 'ab']) -:call add(tl, [2, '\v(((ab)+)+)+', 'dababc', 'abab', 'abab', 'abab', 'ab']) -:call add(tl, [2, '\v(a{0,2})+', 'cc', '']) -:call add(tl, [2, '\v(a*)+', '', '']) -:call add(tl, [2, '\v((a*)+)+', '', '']) -:call add(tl, [2, '\v((ab)*)+', '', '']) -:call add(tl, [2, '\va{1,3}', 'aab', 'aa']) -:call add(tl, [2, '\va{2,3}', 'abaa', 'aa']) -:" -:call add(tl, [2, '\v((ab)+|c*)+', 'abcccaba', 'abcccab', '', 'ab']) -:call add(tl, [2, '\v(a{2})|(b{3})', 'bbabbbb', 'bbb', '', 'bbb']) -:call add(tl, [2, '\va{2}|b{2}', 'abab']) -:call add(tl, [2, '\v(a)+|(c)+', 'bbacbaacbbb', 'a', 'a']) -:call add(tl, [2, '\vab{2,3}c', 'aabbccccccccccccc', 'abbc']) -:call add(tl, [2, '\vab{2,3}c', 'aabbbccccccccccccc', 'abbbc']) -:call add(tl, [2, '\vab{2,3}cd{2,3}e', 'aabbbcddee', 'abbbcdde']) -:call add(tl, [2, '\va(bc){2}d', 'aabcbfbc' ]) -:call add(tl, [2, '\va*a{2}', 'a', ]) -:call add(tl, [2, '\va*a{2}', 'aa', 'aa' ]) -:call add(tl, [2, '\va*a{2}', 'aaa', 'aaa' ]) -:call add(tl, [2, '\va*a{2}', 'bbbabcc', ]) -:call add(tl, [2, '\va*b*|a*c*', 'a', 'a']) -:call add(tl, [2, '\va{1}b{1}|a{1}b{1}', '']) -:" -:"submatches -:call add(tl, [2, '\v(a)', 'ab', 'a', 'a']) -:call add(tl, [2, '\v(a)(b)', 'ab', 'ab', 'a', 'b']) -:call add(tl, [2, '\v(ab)(b)(c)', 'abbc', 'abbc', 'ab', 'b', 'c']) -:call add(tl, [2, '\v((a)(b))', 'ab', 'ab', 'ab', 'a', 'b']) -:call add(tl, [2, '\v(a)|(b)', 'ab', 'a', 'a']) -:" -:call add(tl, [2, '\v(a*)+', 'aaaa', 'aaaa', '']) -:call add(tl, [2, 'x', 'abcdef']) -:" -:"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -:""""" Simple tests """"""""""""""""""""""""""""""""""""""""""" -:"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -:" -:" Search single groups -:call add(tl, [2, 'ab', 'aab', 'ab']) -:call add(tl, [2, 'ab', 'baced']) -:call add(tl, [2, 'ab', ' ab ', 'ab']) -:" -:" Search multi-modifiers -:call add(tl, [2, 'x*', 'xcd', 'x']) -:call add(tl, [2, 'x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx']) -:" empty match is good -:call add(tl, [2, 'x*', 'abcdoij', '']) -:" no match here -:call add(tl, [2, 'x\+', 'abcdoin']) -:call add(tl, [2, 'x\+', 'abcdeoijdfxxiuhfij', 'xx']) -:call add(tl, [2, 'x\+', 'xxxxx', 'xxxxx']) -:call add(tl, [2, 'x\+', 'abc x siufhiush xxxxxxxxx', 'x']) -:call add(tl, [2, 'x\=', 'x sdfoij', 'x']) -:call add(tl, [2, 'x\=', 'abc sfoij', '']) " empty match is good -:call add(tl, [2, 'x\=', 'xxxxxxxxx c', 'x']) -:call add(tl, [2, 'x\?', 'x sdfoij', 'x']) -:" empty match is good -:call add(tl, [2, 'x\?', 'abc sfoij', '']) -:call add(tl, [2, 'x\?', 'xxxxxxxxxx c', 'x']) -:" -:call add(tl, [2, 'a\{0,0}', 'abcdfdoij', '']) -:" same thing as 'a?' -:call add(tl, [2, 'a\{0,1}', 'asiubid axxxaaa', 'a']) -:" same thing as 'a\{0,1}' -:call add(tl, [2, 'a\{1,0}', 'asiubid axxxaaa', 'a']) -:call add(tl, [2, 'a\{3,6}', 'aa siofuh']) -:call add(tl, [2, 'a\{3,6}', 'aaaaa asfoij afaa', 'aaaaa']) -:call add(tl, [2, 'a\{3,6}', 'aaaaaaaa', 'aaaaaa']) -:call add(tl, [2, 'a\{0}', 'asoiuj', '']) -:call add(tl, [2, 'a\{2}', 'aaaa', 'aa']) -:call add(tl, [2, 'a\{2}', 'iuash fiusahfliusah fiushfilushfi uhsaifuh askfj nasfvius afg aaaa sfiuhuhiushf', 'aa']) -:call add(tl, [2, 'a\{2}', 'abcdefghijklmnopqrestuvwxyz1234567890']) -:" same thing as 'a*' -:call add(tl, [2, 'a\{0,}', 'oij sdigfusnf', '']) -:call add(tl, [2, 'a\{0,}', 'aaaaa aa', 'aaaaa']) -:call add(tl, [2, 'a\{2,}', 'sdfiougjdsafg']) -:call add(tl, [2, 'a\{2,}', 'aaaaasfoij ', 'aaaaa']) -:call add(tl, [2, 'a\{5,}', 'xxaaaaxxx ']) -:call add(tl, [2, 'a\{5,}', 'xxaaaaaxxx ', 'aaaaa']) -:call add(tl, [2, 'a\{,0}', 'oidfguih iuhi hiu aaaa', '']) -:call add(tl, [2, 'a\{,5}', 'abcd', 'a']) -:call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa']) -:" leading star as normal char when \{} follows -:call add(tl, [2, '^*\{4,}$', '***']) -:call add(tl, [2, '^*\{4,}$', '****', '****']) -:call add(tl, [2, '^*\{4,}$', '*****', '*****']) -:" same thing as 'a*' -:call add(tl, [2, 'a\{}', 'bbbcddiuhfcd', '']) -:call add(tl, [2, 'a\{}', 'aaaaioudfh coisf jda', 'aaaa']) -:" -:call add(tl, [2, 'a\{-0,0}', 'abcdfdoij', '']) -:" anti-greedy version of 'a?' -:call add(tl, [2, 'a\{-0,1}', 'asiubid axxxaaa', '']) -:call add(tl, [2, 'a\{-3,6}', 'aa siofuh']) -:call add(tl, [2, 'a\{-3,6}', 'aaaaa asfoij afaa', 'aaa']) -:call add(tl, [2, 'a\{-3,6}', 'aaaaaaaa', 'aaa']) -:call add(tl, [2, 'a\{-0}', 'asoiuj', '']) -:call add(tl, [2, 'a\{-2}', 'aaaa', 'aa']) -:call add(tl, [2, 'a\{-2}', 'abcdefghijklmnopqrestuvwxyz1234567890']) -:call add(tl, [2, 'a\{-0,}', 'oij sdigfusnf', '']) -:call add(tl, [2, 'a\{-0,}', 'aaaaa aa', '']) -:call add(tl, [2, 'a\{-2,}', 'sdfiougjdsafg']) -:call add(tl, [2, 'a\{-2,}', 'aaaaasfoij ', 'aa']) -:call add(tl, [2, 'a\{-,0}', 'oidfguih iuhi hiu aaaa', '']) -:call add(tl, [2, 'a\{-,5}', 'abcd', '']) -:call add(tl, [2, 'a\{-,5}', 'aaaaaaaaaa', '']) -:" anti-greedy version of 'a*' -:call add(tl, [2, 'a\{-}', 'bbbcddiuhfcd', '']) -:call add(tl, [2, 'a\{-}', 'aaaaioudfh coisf jda', '']) -:" -:" Test groups of characters and submatches -:call add(tl, [2, '\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc']) -:call add(tl, [2, '\(ab\)\+', 'abababaaaaa', 'ababab', 'ab']) -:call add(tl, [2, '\(abaaaaa\)*cd', 'cd', 'cd', '']) -:call add(tl, [2, '\(test1\)\? \(test2\)\?', 'test1 test3', 'test1 ', 'test1', '']) -:call add(tl, [2, '\(test1\)\= \(test2\) \(test4443\)\=', ' test2 test4443 yupiiiiiiiiiii', ' test2 test4443', '', 'test2', 'test4443']) -:call add(tl, [2, '\(\(sub1\) hello \(sub 2\)\)', 'asterix sub1 hello sub 2 obelix', 'sub1 hello sub 2', 'sub1 hello sub 2', 'sub1', 'sub 2']) -:call add(tl, [2, '\(\(\(yyxxzz\)\)\)', 'abcdddsfiusfyyzzxxyyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz']) -:call add(tl, [2, '\v((ab)+|c+)+', 'abcccaba', 'abcccab', 'ab', 'ab']) -:call add(tl, [2, '\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab']) -:call add(tl, [2, '\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', '']) -:call add(tl, [2, '\v(a|b*)+', 'aaaa', 'aaaa', '']) -:call add(tl, [2, '\p*', 'aá ', 'aá ']) -:" -:" Test greedy-ness and lazy-ness -:call add(tl, [2, 'a\{-2,7}','aaaaaaaaaaaaa', 'aa']) -:call add(tl, [2, 'a\{-2,7}x','aaaaaaaaax', 'aaaaaaax']) -:call add(tl, [2, 'a\{2,7}','aaaaaaaaaaaaaaaaaaaa', 'aaaaaaa']) -:call add(tl, [2, 'a\{2,7}x','aaaaaaaaax', 'aaaaaaax']) -:call add(tl, [2, '\vx(.{-,8})yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz','ayxa','xayzxayz']) -:call add(tl, [2, '\vx(.*)yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz', 'ayxayzxayzxa','']) -:call add(tl, [2, '\v(a{1,2}){-2,3}','aaaaaaa','aaaa','aa']) -:call add(tl, [2, '\v(a{-1,3})+', 'aa', 'aa', 'a']) -:call add(tl, [2, '^\s\{-}\zs\( x\|x$\)', ' x', ' x', ' x']) -:call add(tl, [2, '^\s\{-}\zs\(x\| x$\)', ' x', ' x', ' x']) -:call add(tl, [2, '^\s\{-}\ze\(x\| x$\)', ' x', '', ' x']) -:call add(tl, [2, '^\(\s\{-}\)\(x\| x$\)', ' x', ' x', '', ' x']) -:" -:" Test Character classes -:call add(tl, [2, '\d\+e\d\d','test 10e23 fd','10e23']) -:" -:" Test collections and character range [] -:call add(tl, [2, '\v[a]', 'abcd', 'a']) -:call add(tl, [2, 'a[bcd]', 'abcd', 'ab']) -:call add(tl, [2, 'a[b-d]', 'acbd', 'ac']) -:call add(tl, [2, '[a-d][e-f][x-x]d', 'cexdxx', 'cexd']) -:call add(tl, [2, '\v[[:alpha:]]+', 'abcdefghijklmnopqrstuvwxyz6','abcdefghijklmnopqrstuvwxyz']) -:call add(tl, [2, '[[:alpha:]\+]', '6x8','x']) -:call add(tl, [2, '[^abc]\+','abcabcabc']) -:call add(tl, [2, '[^abc]','defghiasijvoinasoiunbvb','d']) -:call add(tl, [2, '[^abc]\+','ddddddda','ddddddd']) -:call add(tl, [2, '[^a-d]\+','aaaAAAZIHFNCddd','AAAZIHFNC']) -:call add(tl, [2, '[a-f]*','iiiiiiii','']) -:call add(tl, [2, '[a-f]*','abcdefgh','abcdef']) -:call add(tl, [2, '[^a-f]\+','abcdefgh','gh']) -:call add(tl, [2, '[a-c]\{-3,6}','abcabc','abc']) -:call add(tl, [2, '[^[:alpha:]]\+','abcccadfoij7787ysf287yrnccdu','7787']) -:call add(tl, [2, '[-a]', '-', '-']) -:call add(tl, [2, '[a-]', '-', '-']) -:call add(tl, [2, '[a-f]*\c','ABCDEFGH','ABCDEF']) -:call add(tl, [2, '[abc][xyz]\c','-af-AF-BY--','BY']) -:" filename regexp -:call add(tl, [2, '[-./[:alnum:]_~]\+', 'log13.file', 'log13.file']) -:" special chars -:call add(tl, [2, '[\]\^\-\\]\+', '\^\\\-\---^', '\^\\\-\---^']) -:" collation elem -:call add(tl, [2, '[[.a.]]\+', 'aa', 'aa']) -:" middle of regexp -:call add(tl, [2, 'abc[0-9]*ddd', 'siuhabc ii']) -:call add(tl, [2, 'abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd']) -:call add(tl, [2, '\_[0-9]\+', 'asfi9888u', '9888']) -:call add(tl, [2, '[0-9\n]\+', 'asfi9888u', '9888']) -:call add(tl, [2, '\_[0-9]\+', "asfi\n9888u", "\n9888"]) -:call add(tl, [2, '\_f', " \na ", "\n"]) -:call add(tl, [2, '\_f\+', " \na ", "\na"]) -:call add(tl, [2, '[0-9A-Za-z-_.]\+', " @0_a.A-{ ", "0_a.A-"]) -:" -:"""" Test start/end of line, start/end of file -:call add(tl, [2, '^a.', "a_\nb ", "a_"]) -:call add(tl, [2, '^a.', "b a \na_"]) -:call add(tl, [2, '.a$', " a\n "]) -:call add(tl, [2, '.a$', " a b\n_a", "_a"]) -:call add(tl, [2, '\%^a.', "a a\na", "a "]) -:call add(tl, [2, '\%^a', " a \na "]) -:call add(tl, [2, '.a\%$', " a\n "]) -:call add(tl, [2, '.a\%$', " a\n_a", "_a"]) -:" -:"""" Test recognition of character classes -:call add(tl, [2, '[0-7]\+', 'x0123456789x', '01234567']) -:call add(tl, [2, '[^0-7]\+', '0a;X+% 897', 'a;X+% 89']) -:call add(tl, [2, '[0-9]\+', 'x0123456789x', '0123456789']) -:call add(tl, [2, '[^0-9]\+', '0a;X+% 9', 'a;X+% ']) -:call add(tl, [2, '[0-9a-fA-F]\+', 'x0189abcdefg', '0189abcdef']) -:call add(tl, [2, '[^0-9A-Fa-f]\+', '0189g;X+% ab', 'g;X+% ']) -:call add(tl, [2, '[a-z_A-Z0-9]\+', ';+aso_SfOij ', 'aso_SfOij']) -:call add(tl, [2, '[^a-z_A-Z0-9]\+', 'aSo_;+% sfOij', ';+% ']) -:call add(tl, [2, '[a-z_A-Z]\+', '0abyz_ABYZ;', 'abyz_ABYZ']) -:call add(tl, [2, '[^a-z_A-Z]\+', 'abAB_09;+% yzYZ', '09;+% ']) -:call add(tl, [2, '[a-z]\+', '0abcxyz1', 'abcxyz']) -:call add(tl, [2, '[a-z]\+', 'AabxyzZ', 'abxyz']) -:call add(tl, [2, '[^a-z]\+', 'a;X09+% x', ';X09+% ']) -:call add(tl, [2, '[^a-z]\+', 'abX0;%yz', 'X0;%']) -:call add(tl, [2, '[a-zA-Z]\+', '0abABxzXZ9', 'abABxzXZ']) -:call add(tl, [2, '[^a-zA-Z]\+', 'ab09_;+ XZ', '09_;+ ']) -:call add(tl, [2, '[A-Z]\+', 'aABXYZz', 'ABXYZ']) -:call add(tl, [2, '[^A-Z]\+', 'ABx0;%YZ', 'x0;%']) -:call add(tl, [2, '[a-z]\+\c', '0abxyzABXYZ;', 'abxyzABXYZ']) -:call add(tl, [2, '[A-Z]\+\c', '0abABxzXZ9', 'abABxzXZ']) -:call add(tl, [2, '\c[^a-z]\+', 'ab09_;+ XZ', '09_;+ ']) -:call add(tl, [2, '\c[^A-Z]\+', 'ab09_;+ XZ', '09_;+ ']) -:call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa']) -:" -:"""" Tests for \z features -:" match ends at \ze -:call add(tl, [2, 'xx \ze test', 'xx ']) -:call add(tl, [2, 'abc\zeend', 'oij abcend', 'abc']) -:call add(tl, [2, 'aa\zebb\|aaxx', ' aabb ', 'aa']) -:call add(tl, [2, 'aa\zebb\|aaxx', ' aaxx ', 'aaxx']) -:call add(tl, [2, 'aabb\|aa\zebb', ' aabb ', 'aabb']) -:call add(tl, [2, 'aa\zebb\|aaebb', ' aabb ', 'aa']) -:" match starts at \zs -:call add(tl, [2, 'abc\zsdd', 'ddabcddxyzt', 'dd']) -:call add(tl, [2, 'aa \zsax', ' ax']) -:call add(tl, [2, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match']) -:call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last']) -:call add(tl, [2, '\>\zs.', 'aword. ', '.']) -:call add(tl, [2, '\s\+\ze\[/\|\s\zs\s\+', 'is [a t', ' ']) -:" -:"""" Tests for \@= and \& features -:call add(tl, [2, 'abc\@=', 'abc', 'ab']) -:call add(tl, [2, 'abc\@=cd', 'abcd', 'abcd']) -:call add(tl, [2, 'abc\@=', 'ababc', 'ab']) -:" will never match, no matter the input text -:call add(tl, [2, 'abcd\@=e', 'abcd']) -:" will never match -:call add(tl, [2, 'abcd\@=e', 'any text in here ... ']) -:call add(tl, [2, '\v(abc)@=..', 'xabcd', 'ab', 'abc']) -:call add(tl, [2, '\(.*John\)\@=.*Bob', 'here is John, and here is B']) -:call add(tl, [2, '\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend']) -:call add(tl, [2, '\<\S\+\())\)\@=', '$((i=i+1))', 'i=i+1', '))']) -:call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B']) -:call add(tl, [2, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob']) -:call add(tl, [2, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1']) -:call add(tl, [2, 'foo\(bar\)\@!', 'foobar']) -:call add(tl, [2, 'foo\(bar\)\@!', 'foo bar', 'foo']) -:call add(tl, [2, 'if \(\(then\)\@!.\)*$', ' if then else']) -:call add(tl, [2, 'if \(\(then\)\@!.\)*$', ' if else ', 'if else ', ' ']) -:call add(tl, [2, '\(foo\)\@!bar', 'foobar', 'bar']) -:call add(tl, [2, '\(foo\)\@!...bar', 'foobar']) -:call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' bar foo ']) -:call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' foo bar ']) -:call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' foo xxx ', 'foo']) -:call add(tl, [2, '[ ]\@!\p\%([ ]\@!\p\)*:', 'implicit mappings:', 'mappings:']) -:call add(tl, [2, '[ ]\@!\p\([ ]\@!\p\)*:', 'implicit mappings:', 'mappings:', 's']) -:call add(tl, [2, 'm\k\+_\@=\%(_\@!\k\)\@<=\k\+e', 'mx__xe', 'mx__xe']) -:call add(tl, [2, '\%(\U\@<=S\k*\|S\l\)R', 'SuR', 'SuR']) -:" -:"""" Combining different tests and features -:call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab']) -:call add(tl, [2, '', 'abcd', '']) -:call add(tl, [2, '\v(())', 'any possible text', '']) -:call add(tl, [2, '\v%(ab(xyz)c)', ' abxyzc ', 'abxyzc', 'xyz']) -:call add(tl, [2, '\v(test|)empty', 'tesempty', 'empty', '']) -:call add(tl, [2, '\v(a|aa)(a|aa)', 'aaa', 'aa', 'a', 'a']) -:" -:"""" \%u and friends -:call add(tl, [2, '\%d32', 'yes no', ' ']) -:call add(tl, [2, '\%o40', 'yes no', ' ']) -:call add(tl, [2, '\%x20', 'yes no', ' ']) -:call add(tl, [2, '\%u0020', 'yes no', ' ']) -:call add(tl, [2, '\%U00000020', 'yes no', ' ']) -:call add(tl, [2, '\%d0', "yes\x0ano", "\x0a"]) -:" -:""""" \%[abc] -:call add(tl, [2, 'foo\%[bar]', 'fobar']) -:call add(tl, [2, 'foo\%[bar]', 'foobar', 'foobar']) -:call add(tl, [2, 'foo\%[bar]', 'fooxx', 'foo']) -:call add(tl, [2, 'foo\%[bar]', 'foobxx', 'foob']) -:call add(tl, [2, 'foo\%[bar]', 'foobaxx', 'fooba']) -:call add(tl, [2, 'foo\%[bar]', 'foobarxx', 'foobar']) -:call add(tl, [2, 'foo\%[bar]x', 'foobxx', 'foobx']) -:call add(tl, [2, 'foo\%[bar]x', 'foobarxx', 'foobarx']) -:call add(tl, [2, '\%[bar]x', 'barxx', 'barx']) -:call add(tl, [2, '\%[bar]x', 'bxx', 'bx']) -:call add(tl, [2, '\%[bar]x', 'xxx', 'x']) -:call add(tl, [2, 'b\%[[ao]r]', 'bar bor', 'bar']) -:call add(tl, [2, 'b\%[[]]r]', 'b]r bor', 'b]r']) -:call add(tl, [2, '@\%[\w\-]*', '<http://john.net/pandoc/>[@pandoc]', '@pandoc']) -:" -:"""" Alternatives, must use first longest match -:call add(tl, [2, 'goo\|go', 'google', 'goo']) -:call add(tl, [2, '\<goo\|\<go', 'google', 'goo']) -:call add(tl, [2, '\<goo\|go', 'google', 'goo']) -:" -:"""" Back references -:call add(tl, [2, '\(\i\+\) \1', ' abc abc', 'abc abc', 'abc']) -:call add(tl, [2, '\(\i\+\) \1', 'xgoo goox', 'goo goo', 'goo']) -:call add(tl, [2, '\(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9', 'xabcddefghiabcddefghix', 'abcddefghiabcddefghi', 'a', 'b', 'c', 'dd', 'e', 'f', 'g', 'h', 'i']) -:call add(tl, [2, '\(\d*\)a \1b', ' a b ', 'a b', '']) -:call add(tl, [2, '^.\(.\).\_..\1.', "aaa\naaa\nb", "aaa\naaa", 'a']) -:call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<!$', 'foo.bat/foo.com', 'foo.bat/foo.com', 'bat']) -:call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<!$', 'foo.bat/foo.bat']) -:call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<=$', 'foo.bat/foo.bat', 'foo.bat/foo.bat', 'bat', 'bat']) -:call add(tl, [2, '\\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}', '2013-06-27${0}', '${0}', '0']) -:call add(tl, [2, '^\(a*\)\1$', 'aaaaaaaa', 'aaaaaaaa', 'aaaa']) -:call add(tl, [2, '^\(a\{-2,}\)\1\+$', 'aaaaaaaaa', 'aaaaaaaaa', 'aaa']) -:" -:"""" Look-behind with limit -:call add(tl, [2, '<\@<=span.', 'xxspanxx<spanyyy', 'spany']) -:call add(tl, [2, '<\@1<=span.', 'xxspanxx<spanyyy', 'spany']) -:call add(tl, [2, '<\@2<=span.', 'xxspanxx<spanyyy', 'spany']) -:call add(tl, [2, '\(<<\)\@<=span.', 'xxspanxxxx<spanxx<<spanyyy', 'spany', '<<']) -:call add(tl, [2, '\(<<\)\@1<=span.', 'xxspanxxxx<spanxx<<spanyyy']) -:call add(tl, [2, '\(<<\)\@2<=span.', 'xxspanxxxx<spanxx<<spanyyy', 'spany', '<<']) -:call add(tl, [2, '\(foo\)\@<!bar.', 'xx foobar1 xbar2 xx', 'bar2']) -:" -:" look-behind match in front of a zero-width item -:call add(tl, [2, '\v\C%(<Last Changed:\s+)@<=.*$', '" test header']) -:call add(tl, [2, '\v\C%(<Last Changed:\s+)@<=.*$', '" Last Changed: 1970', '1970']) -:call add(tl, [2, '\(foo\)\@<=\>', 'foobar']) -:call add(tl, [2, '\(foo\)\@<=\>', 'barfoo', '', 'foo']) -:call add(tl, [2, '\(foo\)\@<=.*', 'foobar', 'bar', 'foo']) -:" -:" complicated look-behind match -:call add(tl, [2, '\(r\@<=\|\w\@<!\)\/', 'x = /word/;', '/']) -:call add(tl, [2, '^[a-z]\+\ze \&\(asdf\)\@<!', 'foo bar', 'foo']) -:" -:""""" \@> -:call add(tl, [2, '\(a*\)\@>a', 'aaaa']) -:call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa']) -:call add(tl, [2, '^\(.\{-}b\)\@>.', ' abcbd', ' abc', ' ab']) -:call add(tl, [2, '\(.\{-}\)\(\)\@>$', 'abc', 'abc', 'abc', '']) -:" TODO: BT engine does not restore submatch after failure -:call add(tl, [1, '\(a*\)\@>a\|a\+', 'aaaa', 'aaaa']) -:" -:"""" "\_" prepended negated collection matches EOL -:call add(tl, [2, '\_[^8-9]\+', "asfi\n9888", "asfi\n"]) -:call add(tl, [2, '\_[^a]\+', "asfi\n9888", "sfi\n9888"]) -:" -:"""" Requiring lots of states. -:call add(tl, [2, '[0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12}', " 12345678-1234-1234-1234-123456789012 ", "12345678-1234-1234-1234-123456789012", "1234-"]) -:" -:"""" Skip adding state twice -:call add(tl, [2, '^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=', "#if FOO", "#if", ' FOO']) -:" -:""" Test \%V atom -:call add(tl, [2, '\%>70vGesamt', 'Jean-Michel Charlier & Victor Hubinon\Gesamtausgabe [Salleck] Buck Danny {Jean-Michel Charlier & Victor Hubinon}\Gesamtausgabe', 'Gesamt']) -:" -:"""" Run the tests -:" -:for t in tl -: let re = t[0] -: let pat = t[1] -: let text = t[2] -: let matchidx = 3 -: for engine in [0, 1, 2] -: if engine == 2 && re == 0 || engine == 1 && re == 1 -: continue -: endif -: let ®expengine = engine -: try -: let l = matchlist(text, pat) -: catch -: $put ='ERROR ' . engine . ': pat: \"' . pat . '\", text: \"' . text . '\", caused an exception: \"' . v:exception . '\"' -: endtry -:" check the match itself -: if len(l) == 0 && len(t) > matchidx -: $put ='ERROR ' . engine . ': pat: \"' . pat . '\", text: \"' . text . '\", did not match, expected: \"' . t[matchidx] . '\"' -: elseif len(l) > 0 && len(t) == matchidx -: $put ='ERROR ' . engine . ': pat: \"' . pat . '\", text: \"' . text . '\", match: \"' . l[0] . '\", expected no match' -: elseif len(t) > matchidx && l[0] != t[matchidx] -: $put ='ERROR ' . engine . ': pat: \"' . pat . '\", text: \"' . text . '\", match: \"' . l[0] . '\", expected: \"' . t[matchidx] . '\"' -: else -: $put ='OK ' . engine . ' - ' . pat -: endif -: if len(l) > 0 -:" check all the nine submatches -: for i in range(1, 9) -: if len(t) <= matchidx + i -: let e = '' -: else -: let e = t[matchidx + i] -: endif -: if l[i] != e -: $put ='ERROR ' . engine . ': pat: \"' . pat . '\", text: \"' . text . '\", submatch ' . i . ': \"' . l[i] . '\", expected: \"' . e . '\"' -: endif -: endfor -: unlet i -: endif -: endfor -:endfor -:unlet t tl e l -:" -:"""""" multi-line tests """""""""""""""""""" -:let tl = [] -:" -:"""" back references -:call add(tl, [2, '^.\(.\).\_..\1.', ['aaa', 'aaa', 'b'], ['XX', 'b']]) -:call add(tl, [2, '\v.*\/(.*)\n.*\/\1$', ['./Dir1/Dir2/zyxwvuts.txt', './Dir1/Dir2/abcdefgh.bat', '', './Dir1/Dir2/file1.txt', './OtherDir1/OtherDir2/file1.txt'], ['./Dir1/Dir2/zyxwvuts.txt', './Dir1/Dir2/abcdefgh.bat', '', 'XX']]) -:" -:"""" line breaks -:call add(tl, [2, '\S.*\nx', ['abc', 'def', 'ghi', 'xjk', 'lmn'], ['abc', 'def', 'XXjk', 'lmn']]) -:" -:" Check that \_[0-9] matching EOL does not break a following \> -:call add(tl, [2, '\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\>', ['', 'localnet/192.168.0.1', ''], ['', 'localnet/XX', '']]) -:" -:" Check a pattern with a line break and ^ and $ -:call add(tl, [2, 'a\n^b$\n^c', ['a', 'b', 'c'], ['XX']]) -:" -:call add(tl, [2, '\(^.\+\n\)\1', [' dog', ' dog', 'asdf'], ['XXasdf']]) -:" -:"""" Run the multi-line tests -:" -:$put ='multi-line tests' -:for t in tl -: let re = t[0] -: let pat = t[1] -: let before = t[2] -: let after = t[3] -: for engine in [0, 1, 2] -: if engine == 2 && re == 0 || engine == 1 && re ==1 -: continue -: endif -: let ®expengine = engine -: new -: call setline(1, before) -: exe '%s/' . pat . '/XX/' -: let result = getline(1, '$') -: q! -: if result != after -: $put ='ERROR: pat: \"' . pat . '\", text: \"' . string(before) . '\", expected: \"' . string(after) . '\", got: \"' . string(result) . '\"' -: else -: $put ='OK ' . engine . ' - ' . pat -: endif -: endfor -:endfor -:unlet t tl -:" -:" Check that using a pattern on two lines doesn't get messed up by using -:" matchstr() with \ze in between. -:set re=0 -/^Substitute here -:.+1,.+2s/""/\='"'.matchstr(getline("."), '\d\+\ze<').'"' -/^Substitute here -:.+1,.+2yank -Gop:" -:" -:" Check a pattern with a look beind crossing a line boundary -/^Behind: -/\(<\_[xy]\+\)\@3<=start -:.yank -Gop:" -:" -:" Check matching Visual area -/^Visual: -jfxvfx:s/\%Ve/E/g -jV:s/\%Va/A/g -jfxfxj:s/\%Vo/O/g -:/^Visual/+1,/^Visual/+4yank -Gop:" -:" -:" Check matching marks -/^Marks: -jfSmsfEme:.-4,.+6s/.\%>'s.*\%<'e../here/ -jfSmsj0fEme:.-4,.+6s/.\%>'s\_.*\%<'e../again/ -:/^Marks:/+1,/^Marks:/+3yank -Gop:" -:" -:" Check patterns matching cursor position. -:func! Postest() - new - call setline(1, ['ffooooo', 'boboooo', 'zoooooo', 'koooooo', 'moooooo', "\t\t\tfoo", 'abababababababfoo', 'bababababababafoo', '********_', ' xxxxxxxxxxxx xxxx xxxxxx xxxxxxx x xxxxxxxxx xx xxxxxx xxxxxx xxxxx xxxxxxx xx xxxx xxxxxxxx xxxx xxxxxxxxxxx xxx xxxxxxx xxxxxxxxx xx xxxxxx xx xxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxx xxx xxxxxxxx xxxxxxxxx xxxx xxx xxxx xxx xxx xxxxx xxxxxxxxxxxx xxxx xxxxxxxxx xxxxxxxxxxx xx xxxxx xxx xxxxxxxx xxxxxx xxx xxx xxxxxxxxx xxxxxxx x xxxxxxxxx xx xxxxxx xxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxx xxx xxx xxxxxxxx xxxxxxx xxxx xxx xxxxxx xxxxx xxxxx xx xxxxxx xxxxxxx xxx xxxxxxxxxxxx xxxx xxxxxxxxx xxxxxx xxxxxx xxxxx xxx xxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxx xxxxxxxxxx xxxx xx xxxxxxxx xxx xxxxxxxxxxx xxxxx']) - call setpos('.', [0, 1, 0, 0]) - s/\%>3c.//g - call setpos('.', [0, 2, 4, 0]) - s/\%#.*$//g - call setpos('.', [0, 3, 0, 0]) - s/\%<3c./_/g - %s/\%4l\%>5c./_/g - %s/\%6l\%>25v./_/g - %s/\%>6l\%3c./!/g - %s/\%>7l\%12c./?/g - %s/\%>7l\%<9l\%>5v\%<8v./#/g - $s/\%(|\u.*\)\@<=[^|\t]\+$//ge - 1,$yank - quit! -endfunc -Go-0-:set re=0 -:call Postest() -:put -o-1-:set re=1 -:call Postest() -:put -o-2-:set re=2 -:call Postest() -:put -:" -:" start and end of buffer -/\%^ -yeGop:" -50%/\%^.. -yeGopA END:" -50%/\%$ -"ayb20gg/..\%$ -"bybGo"apo"bp:" -:" -:" Check for detecting error -:set regexpengine=2 -:for pat in [' \ze*', ' \zs*'] -: try -: let l = matchlist('x x', pat) -: $put ='E888 NOT detected for ' . pat -: catch -: $put ='E888 detected for ' . pat -: endtry -:endfor -:" -:""""" Write the results """"""""""""" -:/\%#=1^Results/,$wq! test.out -ENDTEST - -Substitute here: -<T="">Ta 5</Title> -<T="">Ac 7</Title> - -Behind: -asdfasd<yyy -xxstart1 -asdfasd<yy -xxxstart2 -asdfasd<yy -xxstart3 - -Visual: -thexe the thexethe -andaxand andaxand -oooxofor foroxooo -oooxofor foroxooo - -Marks: -asdfSasdfsadfEasdf -asdfSas -dfsadfEasdf - -Results of test64:
deleted file mode 100644 --- a/src/testdir/test64.ok +++ /dev/null @@ -1,1107 +0,0 @@ -Results of test64: -OK 0 - ab -OK 1 - ab -OK 2 - ab -OK 0 - b -OK 1 - b -OK 2 - b -OK 0 - bc* -OK 1 - bc* -OK 2 - bc* -OK 0 - bc\{-} -OK 1 - bc\{-} -OK 2 - bc\{-} -OK 0 - bc\{-}\(d\) -OK 1 - bc\{-}\(d\) -OK 2 - bc\{-}\(d\) -OK 0 - bc* -OK 1 - bc* -OK 2 - bc* -OK 0 - c* -OK 1 - c* -OK 2 - c* -OK 0 - bc* -OK 1 - bc* -OK 2 - bc* -OK 0 - c* -OK 1 - c* -OK 2 - c* -OK 0 - bc\+ -OK 1 - bc\+ -OK 2 - bc\+ -OK 0 - bc\+ -OK 1 - bc\+ -OK 2 - bc\+ -OK 0 - a\|ab -OK 1 - a\|ab -OK 2 - a\|ab -OK 0 - c\? -OK 1 - c\? -OK 2 - c\? -OK 0 - bc\? -OK 1 - bc\? -OK 2 - bc\? -OK 0 - bc\? -OK 1 - bc\? -OK 2 - bc\? -OK 0 - \va{1} -OK 1 - \va{1} -OK 2 - \va{1} -OK 0 - \va{2} -OK 1 - \va{2} -OK 2 - \va{2} -OK 0 - \va{2} -OK 1 - \va{2} -OK 2 - \va{2} -OK 0 - \va{2} -OK 1 - \va{2} -OK 2 - \va{2} -OK 0 - \va{2} -OK 1 - \va{2} -OK 2 - \va{2} -OK 0 - \va{2} -OK 1 - \va{2} -OK 2 - \va{2} -OK 0 - \va{2} -OK 1 - \va{2} -OK 2 - \va{2} -OK 0 - \vb{1} -OK 1 - \vb{1} -OK 2 - \vb{1} -OK 0 - \vba{2} -OK 1 - \vba{2} -OK 2 - \vba{2} -OK 0 - \vba{3} -OK 1 - \vba{3} -OK 2 - \vba{3} -OK 0 - \v(ab){1} -OK 1 - \v(ab){1} -OK 2 - \v(ab){1} -OK 0 - \v(ab){1} -OK 1 - \v(ab){1} -OK 2 - \v(ab){1} -OK 0 - \v(ab){1} -OK 1 - \v(ab){1} -OK 2 - \v(ab){1} -OK 0 - \v(ab){0,2} -OK 1 - \v(ab){0,2} -OK 2 - \v(ab){0,2} -OK 0 - \v(ab){0,2} -OK 1 - \v(ab){0,2} -OK 2 - \v(ab){0,2} -OK 0 - \v(ab){1,2} -OK 1 - \v(ab){1,2} -OK 2 - \v(ab){1,2} -OK 0 - \v(ab){1,2} -OK 1 - \v(ab){1,2} -OK 2 - \v(ab){1,2} -OK 0 - \v(ab){2,4} -OK 1 - \v(ab){2,4} -OK 2 - \v(ab){2,4} -OK 0 - \v(ab){2,4} -OK 1 - \v(ab){2,4} -OK 2 - \v(ab){2,4} -OK 0 - \v(ab){2} -OK 1 - \v(ab){2} -OK 2 - \v(ab){2} -OK 0 - \v(ab){2} -OK 1 - \v(ab){2} -OK 2 - \v(ab){2} -OK 0 - \v(ab){2} -OK 1 - \v(ab){2} -OK 2 - \v(ab){2} -OK 0 - \v(ab){2} -OK 1 - \v(ab){2} -OK 2 - \v(ab){2} -OK 0 - \v((ab){2}){2} -OK 1 - \v((ab){2}){2} -OK 2 - \v((ab){2}){2} -OK 0 - \v((ab){2}){2} -OK 1 - \v((ab){2}){2} -OK 2 - \v((ab){2}){2} -OK 0 - \v(a{1}){1} -OK 1 - \v(a{1}){1} -OK 2 - \v(a{1}){1} -OK 0 - \v(a{2}){1} -OK 1 - \v(a{2}){1} -OK 2 - \v(a{2}){1} -OK 0 - \v(a{2}){1} -OK 1 - \v(a{2}){1} -OK 2 - \v(a{2}){1} -OK 0 - \v(a{2}){1} -OK 1 - \v(a{2}){1} -OK 2 - \v(a{2}){1} -OK 0 - \v(a{1}){2} -OK 1 - \v(a{1}){2} -OK 2 - \v(a{1}){2} -OK 0 - \v(a{1}){2} -OK 1 - \v(a{1}){2} -OK 2 - \v(a{1}){2} -OK 0 - \v(a{2})+ -OK 1 - \v(a{2})+ -OK 2 - \v(a{2})+ -OK 0 - \v(a{2})+ -OK 1 - \v(a{2})+ -OK 2 - \v(a{2})+ -OK 0 - \v(a{2}){1} -OK 1 - \v(a{2}){1} -OK 2 - \v(a{2}){1} -OK 0 - \v(a{1}){2} -OK 1 - \v(a{1}){2} -OK 2 - \v(a{1}){2} -OK 0 - \v(a{1}){1} -OK 1 - \v(a{1}){1} -OK 2 - \v(a{1}){1} -OK 0 - \v(a{2}){2} -OK 1 - \v(a{2}){2} -OK 2 - \v(a{2}){2} -OK 0 - \v(a{2}){2} -OK 1 - \v(a{2}){2} -OK 2 - \v(a{2}){2} -OK 0 - \v(a+){2} -OK 1 - \v(a+){2} -OK 2 - \v(a+){2} -OK 0 - \v(a{3}){2} -OK 1 - \v(a{3}){2} -OK 2 - \v(a{3}){2} -OK 0 - \v(a{1,2}){2} -OK 1 - \v(a{1,2}){2} -OK 2 - \v(a{1,2}){2} -OK 0 - \v(a{1,3}){2} -OK 1 - \v(a{1,3}){2} -OK 2 - \v(a{1,3}){2} -OK 0 - \v(a{1,3}){2} -OK 1 - \v(a{1,3}){2} -OK 2 - \v(a{1,3}){2} -OK 0 - \v(a{1,3}){3} -OK 1 - \v(a{1,3}){3} -OK 2 - \v(a{1,3}){3} -OK 0 - \v(a{1,2}){2} -OK 1 - \v(a{1,2}){2} -OK 2 - \v(a{1,2}){2} -OK 0 - \v(a+)+ -OK 1 - \v(a+)+ -OK 2 - \v(a+)+ -OK 0 - \v(a+)+ -OK 1 - \v(a+)+ -OK 2 - \v(a+)+ -OK 0 - \v(a+){1,2} -OK 1 - \v(a+){1,2} -OK 2 - \v(a+){1,2} -OK 0 - \v(a+)(a+) -OK 1 - \v(a+)(a+) -OK 2 - \v(a+)(a+) -OK 0 - \v(a{3})+ -OK 1 - \v(a{3})+ -OK 2 - \v(a{3})+ -OK 0 - \v(a|b|c)+ -OK 1 - \v(a|b|c)+ -OK 2 - \v(a|b|c)+ -OK 0 - \v(a|b|c){2} -OK 1 - \v(a|b|c){2} -OK 2 - \v(a|b|c){2} -OK 0 - \v(abc){2} -OK 1 - \v(abc){2} -OK 2 - \v(abc){2} -OK 0 - \v(abc){2} -OK 1 - \v(abc){2} -OK 2 - \v(abc){2} -OK 0 - a* -OK 1 - a* -OK 2 - a* -OK 0 - \v(a*)+ -OK 1 - \v(a*)+ -OK 2 - \v(a*)+ -OK 0 - \v((ab)+)+ -OK 1 - \v((ab)+)+ -OK 2 - \v((ab)+)+ -OK 0 - \v(((ab)+)+)+ -OK 1 - \v(((ab)+)+)+ -OK 2 - \v(((ab)+)+)+ -OK 0 - \v(((ab)+)+)+ -OK 1 - \v(((ab)+)+)+ -OK 2 - \v(((ab)+)+)+ -OK 0 - \v(a{0,2})+ -OK 1 - \v(a{0,2})+ -OK 2 - \v(a{0,2})+ -OK 0 - \v(a*)+ -OK 1 - \v(a*)+ -OK 2 - \v(a*)+ -OK 0 - \v((a*)+)+ -OK 1 - \v((a*)+)+ -OK 2 - \v((a*)+)+ -OK 0 - \v((ab)*)+ -OK 1 - \v((ab)*)+ -OK 2 - \v((ab)*)+ -OK 0 - \va{1,3} -OK 1 - \va{1,3} -OK 2 - \va{1,3} -OK 0 - \va{2,3} -OK 1 - \va{2,3} -OK 2 - \va{2,3} -OK 0 - \v((ab)+|c*)+ -OK 1 - \v((ab)+|c*)+ -OK 2 - \v((ab)+|c*)+ -OK 0 - \v(a{2})|(b{3}) -OK 1 - \v(a{2})|(b{3}) -OK 2 - \v(a{2})|(b{3}) -OK 0 - \va{2}|b{2} -OK 1 - \va{2}|b{2} -OK 2 - \va{2}|b{2} -OK 0 - \v(a)+|(c)+ -OK 1 - \v(a)+|(c)+ -OK 2 - \v(a)+|(c)+ -OK 0 - \vab{2,3}c -OK 1 - \vab{2,3}c -OK 2 - \vab{2,3}c -OK 0 - \vab{2,3}c -OK 1 - \vab{2,3}c -OK 2 - \vab{2,3}c -OK 0 - \vab{2,3}cd{2,3}e -OK 1 - \vab{2,3}cd{2,3}e -OK 2 - \vab{2,3}cd{2,3}e -OK 0 - \va(bc){2}d -OK 1 - \va(bc){2}d -OK 2 - \va(bc){2}d -OK 0 - \va*a{2} -OK 1 - \va*a{2} -OK 2 - \va*a{2} -OK 0 - \va*a{2} -OK 1 - \va*a{2} -OK 2 - \va*a{2} -OK 0 - \va*a{2} -OK 1 - \va*a{2} -OK 2 - \va*a{2} -OK 0 - \va*a{2} -OK 1 - \va*a{2} -OK 2 - \va*a{2} -OK 0 - \va*b*|a*c* -OK 1 - \va*b*|a*c* -OK 2 - \va*b*|a*c* -OK 0 - \va{1}b{1}|a{1}b{1} -OK 1 - \va{1}b{1}|a{1}b{1} -OK 2 - \va{1}b{1}|a{1}b{1} -OK 0 - \v(a) -OK 1 - \v(a) -OK 2 - \v(a) -OK 0 - \v(a)(b) -OK 1 - \v(a)(b) -OK 2 - \v(a)(b) -OK 0 - \v(ab)(b)(c) -OK 1 - \v(ab)(b)(c) -OK 2 - \v(ab)(b)(c) -OK 0 - \v((a)(b)) -OK 1 - \v((a)(b)) -OK 2 - \v((a)(b)) -OK 0 - \v(a)|(b) -OK 1 - \v(a)|(b) -OK 2 - \v(a)|(b) -OK 0 - \v(a*)+ -OK 1 - \v(a*)+ -OK 2 - \v(a*)+ -OK 0 - x -OK 1 - x -OK 2 - x -OK 0 - ab -OK 1 - ab -OK 2 - ab -OK 0 - ab -OK 1 - ab -OK 2 - ab -OK 0 - ab -OK 1 - ab -OK 2 - ab -OK 0 - x* -OK 1 - x* -OK 2 - x* -OK 0 - x* -OK 1 - x* -OK 2 - x* -OK 0 - x* -OK 1 - x* -OK 2 - x* -OK 0 - x\+ -OK 1 - x\+ -OK 2 - x\+ -OK 0 - x\+ -OK 1 - x\+ -OK 2 - x\+ -OK 0 - x\+ -OK 1 - x\+ -OK 2 - x\+ -OK 0 - x\+ -OK 1 - x\+ -OK 2 - x\+ -OK 0 - x\= -OK 1 - x\= -OK 2 - x\= -OK 0 - x\= -OK 1 - x\= -OK 2 - x\= -OK 0 - x\= -OK 1 - x\= -OK 2 - x\= -OK 0 - x\? -OK 1 - x\? -OK 2 - x\? -OK 0 - x\? -OK 1 - x\? -OK 2 - x\? -OK 0 - x\? -OK 1 - x\? -OK 2 - x\? -OK 0 - a\{0,0} -OK 1 - a\{0,0} -OK 2 - a\{0,0} -OK 0 - a\{0,1} -OK 1 - a\{0,1} -OK 2 - a\{0,1} -OK 0 - a\{1,0} -OK 1 - a\{1,0} -OK 2 - a\{1,0} -OK 0 - a\{3,6} -OK 1 - a\{3,6} -OK 2 - a\{3,6} -OK 0 - a\{3,6} -OK 1 - a\{3,6} -OK 2 - a\{3,6} -OK 0 - a\{3,6} -OK 1 - a\{3,6} -OK 2 - a\{3,6} -OK 0 - a\{0} -OK 1 - a\{0} -OK 2 - a\{0} -OK 0 - a\{2} -OK 1 - a\{2} -OK 2 - a\{2} -OK 0 - a\{2} -OK 1 - a\{2} -OK 2 - a\{2} -OK 0 - a\{2} -OK 1 - a\{2} -OK 2 - a\{2} -OK 0 - a\{0,} -OK 1 - a\{0,} -OK 2 - a\{0,} -OK 0 - a\{0,} -OK 1 - a\{0,} -OK 2 - a\{0,} -OK 0 - a\{2,} -OK 1 - a\{2,} -OK 2 - a\{2,} -OK 0 - a\{2,} -OK 1 - a\{2,} -OK 2 - a\{2,} -OK 0 - a\{5,} -OK 1 - a\{5,} -OK 2 - a\{5,} -OK 0 - a\{5,} -OK 1 - a\{5,} -OK 2 - a\{5,} -OK 0 - a\{,0} -OK 1 - a\{,0} -OK 2 - a\{,0} -OK 0 - a\{,5} -OK 1 - a\{,5} -OK 2 - a\{,5} -OK 0 - a\{,5} -OK 1 - a\{,5} -OK 2 - a\{,5} -OK 0 - ^*\{4,}$ -OK 1 - ^*\{4,}$ -OK 2 - ^*\{4,}$ -OK 0 - ^*\{4,}$ -OK 1 - ^*\{4,}$ -OK 2 - ^*\{4,}$ -OK 0 - ^*\{4,}$ -OK 1 - ^*\{4,}$ -OK 2 - ^*\{4,}$ -OK 0 - a\{} -OK 1 - a\{} -OK 2 - a\{} -OK 0 - a\{} -OK 1 - a\{} -OK 2 - a\{} -OK 0 - a\{-0,0} -OK 1 - a\{-0,0} -OK 2 - a\{-0,0} -OK 0 - a\{-0,1} -OK 1 - a\{-0,1} -OK 2 - a\{-0,1} -OK 0 - a\{-3,6} -OK 1 - a\{-3,6} -OK 2 - a\{-3,6} -OK 0 - a\{-3,6} -OK 1 - a\{-3,6} -OK 2 - a\{-3,6} -OK 0 - a\{-3,6} -OK 1 - a\{-3,6} -OK 2 - a\{-3,6} -OK 0 - a\{-0} -OK 1 - a\{-0} -OK 2 - a\{-0} -OK 0 - a\{-2} -OK 1 - a\{-2} -OK 2 - a\{-2} -OK 0 - a\{-2} -OK 1 - a\{-2} -OK 2 - a\{-2} -OK 0 - a\{-0,} -OK 1 - a\{-0,} -OK 2 - a\{-0,} -OK 0 - a\{-0,} -OK 1 - a\{-0,} -OK 2 - a\{-0,} -OK 0 - a\{-2,} -OK 1 - a\{-2,} -OK 2 - a\{-2,} -OK 0 - a\{-2,} -OK 1 - a\{-2,} -OK 2 - a\{-2,} -OK 0 - a\{-,0} -OK 1 - a\{-,0} -OK 2 - a\{-,0} -OK 0 - a\{-,5} -OK 1 - a\{-,5} -OK 2 - a\{-,5} -OK 0 - a\{-,5} -OK 1 - a\{-,5} -OK 2 - a\{-,5} -OK 0 - a\{-} -OK 1 - a\{-} -OK 2 - a\{-} -OK 0 - a\{-} -OK 1 - a\{-} -OK 2 - a\{-} -OK 0 - \(abc\)* -OK 1 - \(abc\)* -OK 2 - \(abc\)* -OK 0 - \(ab\)\+ -OK 1 - \(ab\)\+ -OK 2 - \(ab\)\+ -OK 0 - \(abaaaaa\)*cd -OK 1 - \(abaaaaa\)*cd -OK 2 - \(abaaaaa\)*cd -OK 0 - \(test1\)\? \(test2\)\? -OK 1 - \(test1\)\? \(test2\)\? -OK 2 - \(test1\)\? \(test2\)\? -OK 0 - \(test1\)\= \(test2\) \(test4443\)\= -OK 1 - \(test1\)\= \(test2\) \(test4443\)\= -OK 2 - \(test1\)\= \(test2\) \(test4443\)\= -OK 0 - \(\(sub1\) hello \(sub 2\)\) -OK 1 - \(\(sub1\) hello \(sub 2\)\) -OK 2 - \(\(sub1\) hello \(sub 2\)\) -OK 0 - \(\(\(yyxxzz\)\)\) -OK 1 - \(\(\(yyxxzz\)\)\) -OK 2 - \(\(\(yyxxzz\)\)\) -OK 0 - \v((ab)+|c+)+ -OK 1 - \v((ab)+|c+)+ -OK 2 - \v((ab)+|c+)+ -OK 0 - \v((ab)|c*)+ -OK 1 - \v((ab)|c*)+ -OK 2 - \v((ab)|c*)+ -OK 0 - \v(a(c*)+b)+ -OK 1 - \v(a(c*)+b)+ -OK 2 - \v(a(c*)+b)+ -OK 0 - \v(a|b*)+ -OK 1 - \v(a|b*)+ -OK 2 - \v(a|b*)+ -OK 0 - \p* -OK 1 - \p* -OK 2 - \p* -OK 0 - a\{-2,7} -OK 1 - a\{-2,7} -OK 2 - a\{-2,7} -OK 0 - a\{-2,7}x -OK 1 - a\{-2,7}x -OK 2 - a\{-2,7}x -OK 0 - a\{2,7} -OK 1 - a\{2,7} -OK 2 - a\{2,7} -OK 0 - a\{2,7}x -OK 1 - a\{2,7}x -OK 2 - a\{2,7}x -OK 0 - \vx(.{-,8})yz(.*) -OK 1 - \vx(.{-,8})yz(.*) -OK 2 - \vx(.{-,8})yz(.*) -OK 0 - \vx(.*)yz(.*) -OK 1 - \vx(.*)yz(.*) -OK 2 - \vx(.*)yz(.*) -OK 0 - \v(a{1,2}){-2,3} -OK 1 - \v(a{1,2}){-2,3} -OK 2 - \v(a{1,2}){-2,3} -OK 0 - \v(a{-1,3})+ -OK 1 - \v(a{-1,3})+ -OK 2 - \v(a{-1,3})+ -OK 0 - ^\s\{-}\zs\( x\|x$\) -OK 1 - ^\s\{-}\zs\( x\|x$\) -OK 2 - ^\s\{-}\zs\( x\|x$\) -OK 0 - ^\s\{-}\zs\(x\| x$\) -OK 1 - ^\s\{-}\zs\(x\| x$\) -OK 2 - ^\s\{-}\zs\(x\| x$\) -OK 0 - ^\s\{-}\ze\(x\| x$\) -OK 1 - ^\s\{-}\ze\(x\| x$\) -OK 2 - ^\s\{-}\ze\(x\| x$\) -OK 0 - ^\(\s\{-}\)\(x\| x$\) -OK 1 - ^\(\s\{-}\)\(x\| x$\) -OK 2 - ^\(\s\{-}\)\(x\| x$\) -OK 0 - \d\+e\d\d -OK 1 - \d\+e\d\d -OK 2 - \d\+e\d\d -OK 0 - \v[a] -OK 1 - \v[a] -OK 2 - \v[a] -OK 0 - a[bcd] -OK 1 - a[bcd] -OK 2 - a[bcd] -OK 0 - a[b-d] -OK 1 - a[b-d] -OK 2 - a[b-d] -OK 0 - [a-d][e-f][x-x]d -OK 1 - [a-d][e-f][x-x]d -OK 2 - [a-d][e-f][x-x]d -OK 0 - \v[[:alpha:]]+ -OK 1 - \v[[:alpha:]]+ -OK 2 - \v[[:alpha:]]+ -OK 0 - [[:alpha:]\+] -OK 1 - [[:alpha:]\+] -OK 2 - [[:alpha:]\+] -OK 0 - [^abc]\+ -OK 1 - [^abc]\+ -OK 2 - [^abc]\+ -OK 0 - [^abc] -OK 1 - [^abc] -OK 2 - [^abc] -OK 0 - [^abc]\+ -OK 1 - [^abc]\+ -OK 2 - [^abc]\+ -OK 0 - [^a-d]\+ -OK 1 - [^a-d]\+ -OK 2 - [^a-d]\+ -OK 0 - [a-f]* -OK 1 - [a-f]* -OK 2 - [a-f]* -OK 0 - [a-f]* -OK 1 - [a-f]* -OK 2 - [a-f]* -OK 0 - [^a-f]\+ -OK 1 - [^a-f]\+ -OK 2 - [^a-f]\+ -OK 0 - [a-c]\{-3,6} -OK 1 - [a-c]\{-3,6} -OK 2 - [a-c]\{-3,6} -OK 0 - [^[:alpha:]]\+ -OK 1 - [^[:alpha:]]\+ -OK 2 - [^[:alpha:]]\+ -OK 0 - [-a] -OK 1 - [-a] -OK 2 - [-a] -OK 0 - [a-] -OK 1 - [a-] -OK 2 - [a-] -OK 0 - [a-f]*\c -OK 1 - [a-f]*\c -OK 2 - [a-f]*\c -OK 0 - [abc][xyz]\c -OK 1 - [abc][xyz]\c -OK 2 - [abc][xyz]\c -OK 0 - [-./[:alnum:]_~]\+ -OK 1 - [-./[:alnum:]_~]\+ -OK 2 - [-./[:alnum:]_~]\+ -OK 0 - [\]\^\-\\]\+ -OK 1 - [\]\^\-\\]\+ -OK 2 - [\]\^\-\\]\+ -OK 0 - [[.a.]]\+ -OK 1 - [[.a.]]\+ -OK 2 - [[.a.]]\+ -OK 0 - abc[0-9]*ddd -OK 1 - abc[0-9]*ddd -OK 2 - abc[0-9]*ddd -OK 0 - abc[0-9]*ddd -OK 1 - abc[0-9]*ddd -OK 2 - abc[0-9]*ddd -OK 0 - \_[0-9]\+ -OK 1 - \_[0-9]\+ -OK 2 - \_[0-9]\+ -OK 0 - [0-9\n]\+ -OK 1 - [0-9\n]\+ -OK 2 - [0-9\n]\+ -OK 0 - \_[0-9]\+ -OK 1 - \_[0-9]\+ -OK 2 - \_[0-9]\+ -OK 0 - \_f -OK 1 - \_f -OK 2 - \_f -OK 0 - \_f\+ -OK 1 - \_f\+ -OK 2 - \_f\+ -OK 0 - [0-9A-Za-z-_.]\+ -OK 1 - [0-9A-Za-z-_.]\+ -OK 2 - [0-9A-Za-z-_.]\+ -OK 0 - ^a. -OK 1 - ^a. -OK 2 - ^a. -OK 0 - ^a. -OK 1 - ^a. -OK 2 - ^a. -OK 0 - .a$ -OK 1 - .a$ -OK 2 - .a$ -OK 0 - .a$ -OK 1 - .a$ -OK 2 - .a$ -OK 0 - \%^a. -OK 1 - \%^a. -OK 2 - \%^a. -OK 0 - \%^a -OK 1 - \%^a -OK 2 - \%^a -OK 0 - .a\%$ -OK 1 - .a\%$ -OK 2 - .a\%$ -OK 0 - .a\%$ -OK 1 - .a\%$ -OK 2 - .a\%$ -OK 0 - [0-7]\+ -OK 1 - [0-7]\+ -OK 2 - [0-7]\+ -OK 0 - [^0-7]\+ -OK 1 - [^0-7]\+ -OK 2 - [^0-7]\+ -OK 0 - [0-9]\+ -OK 1 - [0-9]\+ -OK 2 - [0-9]\+ -OK 0 - [^0-9]\+ -OK 1 - [^0-9]\+ -OK 2 - [^0-9]\+ -OK 0 - [0-9a-fA-F]\+ -OK 1 - [0-9a-fA-F]\+ -OK 2 - [0-9a-fA-F]\+ -OK 0 - [^0-9A-Fa-f]\+ -OK 1 - [^0-9A-Fa-f]\+ -OK 2 - [^0-9A-Fa-f]\+ -OK 0 - [a-z_A-Z0-9]\+ -OK 1 - [a-z_A-Z0-9]\+ -OK 2 - [a-z_A-Z0-9]\+ -OK 0 - [^a-z_A-Z0-9]\+ -OK 1 - [^a-z_A-Z0-9]\+ -OK 2 - [^a-z_A-Z0-9]\+ -OK 0 - [a-z_A-Z]\+ -OK 1 - [a-z_A-Z]\+ -OK 2 - [a-z_A-Z]\+ -OK 0 - [^a-z_A-Z]\+ -OK 1 - [^a-z_A-Z]\+ -OK 2 - [^a-z_A-Z]\+ -OK 0 - [a-z]\+ -OK 1 - [a-z]\+ -OK 2 - [a-z]\+ -OK 0 - [a-z]\+ -OK 1 - [a-z]\+ -OK 2 - [a-z]\+ -OK 0 - [^a-z]\+ -OK 1 - [^a-z]\+ -OK 2 - [^a-z]\+ -OK 0 - [^a-z]\+ -OK 1 - [^a-z]\+ -OK 2 - [^a-z]\+ -OK 0 - [a-zA-Z]\+ -OK 1 - [a-zA-Z]\+ -OK 2 - [a-zA-Z]\+ -OK 0 - [^a-zA-Z]\+ -OK 1 - [^a-zA-Z]\+ -OK 2 - [^a-zA-Z]\+ -OK 0 - [A-Z]\+ -OK 1 - [A-Z]\+ -OK 2 - [A-Z]\+ -OK 0 - [^A-Z]\+ -OK 1 - [^A-Z]\+ -OK 2 - [^A-Z]\+ -OK 0 - [a-z]\+\c -OK 1 - [a-z]\+\c -OK 2 - [a-z]\+\c -OK 0 - [A-Z]\+\c -OK 1 - [A-Z]\+\c -OK 2 - [A-Z]\+\c -OK 0 - \c[^a-z]\+ -OK 1 - \c[^a-z]\+ -OK 2 - \c[^a-z]\+ -OK 0 - \c[^A-Z]\+ -OK 1 - \c[^A-Z]\+ -OK 2 - \c[^A-Z]\+ -OK 0 - \C[^A-Z]\+ -OK 1 - \C[^A-Z]\+ -OK 2 - \C[^A-Z]\+ -OK 0 - xx \ze test -OK 1 - xx \ze test -OK 2 - xx \ze test -OK 0 - abc\zeend -OK 1 - abc\zeend -OK 2 - abc\zeend -OK 0 - aa\zebb\|aaxx -OK 1 - aa\zebb\|aaxx -OK 2 - aa\zebb\|aaxx -OK 0 - aa\zebb\|aaxx -OK 1 - aa\zebb\|aaxx -OK 2 - aa\zebb\|aaxx -OK 0 - aabb\|aa\zebb -OK 1 - aabb\|aa\zebb -OK 2 - aabb\|aa\zebb -OK 0 - aa\zebb\|aaebb -OK 1 - aa\zebb\|aaebb -OK 2 - aa\zebb\|aaebb -OK 0 - abc\zsdd -OK 1 - abc\zsdd -OK 2 - abc\zsdd -OK 0 - aa \zsax -OK 1 - aa \zsax -OK 2 - aa \zsax -OK 0 - abc \zsmatch\ze abc -OK 1 - abc \zsmatch\ze abc -OK 2 - abc \zsmatch\ze abc -OK 0 - \v(a \zsif .*){2} -OK 1 - \v(a \zsif .*){2} -OK 2 - \v(a \zsif .*){2} -OK 0 - \>\zs. -OK 1 - \>\zs. -OK 2 - \>\zs. -OK 0 - \s\+\ze\[/\|\s\zs\s\+ -OK 1 - \s\+\ze\[/\|\s\zs\s\+ -OK 2 - \s\+\ze\[/\|\s\zs\s\+ -OK 0 - abc\@= -OK 1 - abc\@= -OK 2 - abc\@= -OK 0 - abc\@=cd -OK 1 - abc\@=cd -OK 2 - abc\@=cd -OK 0 - abc\@= -OK 1 - abc\@= -OK 2 - abc\@= -OK 0 - abcd\@=e -OK 1 - abcd\@=e -OK 2 - abcd\@=e -OK 0 - abcd\@=e -OK 1 - abcd\@=e -OK 2 - abcd\@=e -OK 0 - \v(abc)@=.. -OK 1 - \v(abc)@=.. -OK 2 - \v(abc)@=.. -OK 0 - \(.*John\)\@=.*Bob -OK 1 - \(.*John\)\@=.*Bob -OK 2 - \(.*John\)\@=.*Bob -OK 0 - \(John.*\)\@=.*Bob -OK 1 - \(John.*\)\@=.*Bob -OK 2 - \(John.*\)\@=.*Bob -OK 0 - \<\S\+\())\)\@= -OK 1 - \<\S\+\())\)\@= -OK 2 - \<\S\+\())\)\@= -OK 0 - .*John\&.*Bob -OK 1 - .*John\&.*Bob -OK 2 - .*John\&.*Bob -OK 0 - .*John\&.*Bob -OK 1 - .*John\&.*Bob -OK 2 - .*John\&.*Bob -OK 0 - \v(test1)@=.*yep -OK 1 - \v(test1)@=.*yep -OK 2 - \v(test1)@=.*yep -OK 0 - foo\(bar\)\@! -OK 1 - foo\(bar\)\@! -OK 2 - foo\(bar\)\@! -OK 0 - foo\(bar\)\@! -OK 1 - foo\(bar\)\@! -OK 2 - foo\(bar\)\@! -OK 0 - if \(\(then\)\@!.\)*$ -OK 1 - if \(\(then\)\@!.\)*$ -OK 2 - if \(\(then\)\@!.\)*$ -OK 0 - if \(\(then\)\@!.\)*$ -OK 1 - if \(\(then\)\@!.\)*$ -OK 2 - if \(\(then\)\@!.\)*$ -OK 0 - \(foo\)\@!bar -OK 1 - \(foo\)\@!bar -OK 2 - \(foo\)\@!bar -OK 0 - \(foo\)\@!...bar -OK 1 - \(foo\)\@!...bar -OK 2 - \(foo\)\@!...bar -OK 0 - ^\%(.*bar\)\@!.*\zsfoo -OK 1 - ^\%(.*bar\)\@!.*\zsfoo -OK 2 - ^\%(.*bar\)\@!.*\zsfoo -OK 0 - ^\%(.*bar\)\@!.*\zsfoo -OK 1 - ^\%(.*bar\)\@!.*\zsfoo -OK 2 - ^\%(.*bar\)\@!.*\zsfoo -OK 0 - ^\%(.*bar\)\@!.*\zsfoo -OK 1 - ^\%(.*bar\)\@!.*\zsfoo -OK 2 - ^\%(.*bar\)\@!.*\zsfoo -OK 0 - [ ]\@!\p\%([ ]\@!\p\)*: -OK 1 - [ ]\@!\p\%([ ]\@!\p\)*: -OK 2 - [ ]\@!\p\%([ ]\@!\p\)*: -OK 0 - [ ]\@!\p\([ ]\@!\p\)*: -OK 1 - [ ]\@!\p\([ ]\@!\p\)*: -OK 2 - [ ]\@!\p\([ ]\@!\p\)*: -OK 0 - m\k\+_\@=\%(_\@!\k\)\@<=\k\+e -OK 1 - m\k\+_\@=\%(_\@!\k\)\@<=\k\+e -OK 2 - m\k\+_\@=\%(_\@!\k\)\@<=\k\+e -OK 0 - \%(\U\@<=S\k*\|S\l\)R -OK 1 - \%(\U\@<=S\k*\|S\l\)R -OK 2 - \%(\U\@<=S\k*\|S\l\)R -OK 0 - [[:alpha:]]\{-2,6} -OK 1 - [[:alpha:]]\{-2,6} -OK 2 - [[:alpha:]]\{-2,6} -OK 0 - -OK 1 - -OK 2 - -OK 0 - \v(()) -OK 1 - \v(()) -OK 2 - \v(()) -OK 0 - \v%(ab(xyz)c) -OK 1 - \v%(ab(xyz)c) -OK 2 - \v%(ab(xyz)c) -OK 0 - \v(test|)empty -OK 1 - \v(test|)empty -OK 2 - \v(test|)empty -OK 0 - \v(a|aa)(a|aa) -OK 1 - \v(a|aa)(a|aa) -OK 2 - \v(a|aa)(a|aa) -OK 0 - \%d32 -OK 1 - \%d32 -OK 2 - \%d32 -OK 0 - \%o40 -OK 1 - \%o40 -OK 2 - \%o40 -OK 0 - \%x20 -OK 1 - \%x20 -OK 2 - \%x20 -OK 0 - \%u0020 -OK 1 - \%u0020 -OK 2 - \%u0020 -OK 0 - \%U00000020 -OK 1 - \%U00000020 -OK 2 - \%U00000020 -OK 0 - \%d0 -OK 1 - \%d0 -OK 2 - \%d0 -OK 0 - foo\%[bar] -OK 1 - foo\%[bar] -OK 2 - foo\%[bar] -OK 0 - foo\%[bar] -OK 1 - foo\%[bar] -OK 2 - foo\%[bar] -OK 0 - foo\%[bar] -OK 1 - foo\%[bar] -OK 2 - foo\%[bar] -OK 0 - foo\%[bar] -OK 1 - foo\%[bar] -OK 2 - foo\%[bar] -OK 0 - foo\%[bar] -OK 1 - foo\%[bar] -OK 2 - foo\%[bar] -OK 0 - foo\%[bar] -OK 1 - foo\%[bar] -OK 2 - foo\%[bar] -OK 0 - foo\%[bar]x -OK 1 - foo\%[bar]x -OK 2 - foo\%[bar]x -OK 0 - foo\%[bar]x -OK 1 - foo\%[bar]x -OK 2 - foo\%[bar]x -OK 0 - \%[bar]x -OK 1 - \%[bar]x -OK 2 - \%[bar]x -OK 0 - \%[bar]x -OK 1 - \%[bar]x -OK 2 - \%[bar]x -OK 0 - \%[bar]x -OK 1 - \%[bar]x -OK 2 - \%[bar]x -OK 0 - b\%[[ao]r] -OK 1 - b\%[[ao]r] -OK 2 - b\%[[ao]r] -OK 0 - b\%[[]]r] -OK 1 - b\%[[]]r] -OK 2 - b\%[[]]r] -OK 0 - @\%[\w\-]* -OK 1 - @\%[\w\-]* -OK 2 - @\%[\w\-]* -OK 0 - goo\|go -OK 1 - goo\|go -OK 2 - goo\|go -OK 0 - \<goo\|\<go -OK 1 - \<goo\|\<go -OK 2 - \<goo\|\<go -OK 0 - \<goo\|go -OK 1 - \<goo\|go -OK 2 - \<goo\|go -OK 0 - \(\i\+\) \1 -OK 1 - \(\i\+\) \1 -OK 2 - \(\i\+\) \1 -OK 0 - \(\i\+\) \1 -OK 1 - \(\i\+\) \1 -OK 2 - \(\i\+\) \1 -OK 0 - \(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9 -OK 1 - \(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9 -OK 2 - \(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9 -OK 0 - \(\d*\)a \1b -OK 1 - \(\d*\)a \1b -OK 2 - \(\d*\)a \1b -OK 0 - ^.\(.\).\_..\1. -OK 1 - ^.\(.\).\_..\1. -OK 2 - ^.\(.\).\_..\1. -OK 0 - ^.*\.\(.*\)/.\+\(\1\)\@<!$ -OK 1 - ^.*\.\(.*\)/.\+\(\1\)\@<!$ -OK 2 - ^.*\.\(.*\)/.\+\(\1\)\@<!$ -OK 0 - ^.*\.\(.*\)/.\+\(\1\)\@<!$ -OK 1 - ^.*\.\(.*\)/.\+\(\1\)\@<!$ -OK 2 - ^.*\.\(.*\)/.\+\(\1\)\@<!$ -OK 0 - ^.*\.\(.*\)/.\+\(\1\)\@<=$ -OK 1 - ^.*\.\(.*\)/.\+\(\1\)\@<=$ -OK 2 - ^.*\.\(.*\)/.\+\(\1\)\@<=$ -OK 0 - \\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)} -OK 1 - \\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)} -OK 2 - \\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)} -OK 0 - ^\(a*\)\1$ -OK 1 - ^\(a*\)\1$ -OK 2 - ^\(a*\)\1$ -OK 0 - ^\(a\{-2,}\)\1\+$ -OK 1 - ^\(a\{-2,}\)\1\+$ -OK 2 - ^\(a\{-2,}\)\1\+$ -OK 0 - <\@<=span. -OK 1 - <\@<=span. -OK 2 - <\@<=span. -OK 0 - <\@1<=span. -OK 1 - <\@1<=span. -OK 2 - <\@1<=span. -OK 0 - <\@2<=span. -OK 1 - <\@2<=span. -OK 2 - <\@2<=span. -OK 0 - \(<<\)\@<=span. -OK 1 - \(<<\)\@<=span. -OK 2 - \(<<\)\@<=span. -OK 0 - \(<<\)\@1<=span. -OK 1 - \(<<\)\@1<=span. -OK 2 - \(<<\)\@1<=span. -OK 0 - \(<<\)\@2<=span. -OK 1 - \(<<\)\@2<=span. -OK 2 - \(<<\)\@2<=span. -OK 0 - \(foo\)\@<!bar. -OK 1 - \(foo\)\@<!bar. -OK 2 - \(foo\)\@<!bar. -OK 0 - \v\C%(<Last Changed:\s+)@<=.*$ -OK 1 - \v\C%(<Last Changed:\s+)@<=.*$ -OK 2 - \v\C%(<Last Changed:\s+)@<=.*$ -OK 0 - \v\C%(<Last Changed:\s+)@<=.*$ -OK 1 - \v\C%(<Last Changed:\s+)@<=.*$ -OK 2 - \v\C%(<Last Changed:\s+)@<=.*$ -OK 0 - \(foo\)\@<=\> -OK 1 - \(foo\)\@<=\> -OK 2 - \(foo\)\@<=\> -OK 0 - \(foo\)\@<=\> -OK 1 - \(foo\)\@<=\> -OK 2 - \(foo\)\@<=\> -OK 0 - \(foo\)\@<=.* -OK 1 - \(foo\)\@<=.* -OK 2 - \(foo\)\@<=.* -OK 0 - \(r\@<=\|\w\@<!\)\/ -OK 1 - \(r\@<=\|\w\@<!\)\/ -OK 2 - \(r\@<=\|\w\@<!\)\/ -OK 0 - ^[a-z]\+\ze \&\(asdf\)\@<! -OK 1 - ^[a-z]\+\ze \&\(asdf\)\@<! -OK 2 - ^[a-z]\+\ze \&\(asdf\)\@<! -OK 0 - \(a*\)\@>a -OK 1 - \(a*\)\@>a -OK 2 - \(a*\)\@>a -OK 0 - \(a*\)\@>b -OK 1 - \(a*\)\@>b -OK 2 - \(a*\)\@>b -OK 0 - ^\(.\{-}b\)\@>. -OK 1 - ^\(.\{-}b\)\@>. -OK 2 - ^\(.\{-}b\)\@>. -OK 0 - \(.\{-}\)\(\)\@>$ -OK 1 - \(.\{-}\)\(\)\@>$ -OK 2 - \(.\{-}\)\(\)\@>$ -OK 0 - \(a*\)\@>a\|a\+ -OK 2 - \(a*\)\@>a\|a\+ -OK 0 - \_[^8-9]\+ -OK 1 - \_[^8-9]\+ -OK 2 - \_[^8-9]\+ -OK 0 - \_[^a]\+ -OK 1 - \_[^a]\+ -OK 2 - \_[^a]\+ -OK 0 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12} -OK 1 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12} -OK 2 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12} -OK 0 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@= -OK 1 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@= -OK 2 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@= -OK 0 - \%>70vGesamt -OK 1 - \%>70vGesamt -OK 2 - \%>70vGesamt -multi-line tests -OK 0 - ^.\(.\).\_..\1. -OK 1 - ^.\(.\).\_..\1. -OK 2 - ^.\(.\).\_..\1. -OK 0 - \v.*\/(.*)\n.*\/\1$ -OK 1 - \v.*\/(.*)\n.*\/\1$ -OK 2 - \v.*\/(.*)\n.*\/\1$ -OK 0 - \S.*\nx -OK 1 - \S.*\nx -OK 2 - \S.*\nx -OK 0 - \<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> -OK 1 - \<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> -OK 2 - \<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> -OK 0 - a\n^b$\n^c -OK 1 - a\n^b$\n^c -OK 2 - a\n^b$\n^c -OK 0 - \(^.\+\n\)\1 -OK 1 - \(^.\+\n\)\1 -OK 2 - \(^.\+\n\)\1 - -<T="5">Ta 5</Title> -<T="7">Ac 7</Title> - -xxstart3 - -thexE thE thExethe -AndAxAnd AndAxAnd -oooxOfOr fOrOxooo -oooxOfOr fOrOxooo - -asdfhereasdf -asdfagainasdf - --0- -ffo -bob -__ooooo -koooo__ -moooooo - f__ -ab!babababababfoo -ba!ab##abab?bafoo -**!*****_ - ! xxx?xxxxxxxx xxxx xxxxxx xxxxxxx x xxxxxxxxx xx xxxxxx xxxxxx xxxxx xxxxxxx xx xxxx xxxxxxxx xxxx xxxxxxxxxxx xxx xxxxxxx xxxxxxxxx xx xxxxxx xx xxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxx xxx xxxxxxxx xxxxxxxxx xxxx xxx xxxx xxx xxx xxxxx xxxxxxxxxxxx xxxx xxxxxxxxx xxxxxxxxxxx xx xxxxx xxx xxxxxxxx xxxxxx xxx xxx xxxxxxxxx xxxxxxx x xxxxxxxxx xx xxxxxx xxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxx xxx xxx xxxxxxxx xxxxxxx xxxx xxx xxxxxx xxxxx xxxxx xx xxxxxx xxxxxxx xxx xxxxxxxxxxxx xxxx xxxxxxxxx xxxxxx xxxxxx xxxxx xxx xxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxx xxxxxxxxxx xxxx xx xxxxxxxx xxx xxxxxxxxxxx xxxxx --1- -ffo -bob -__ooooo -koooo__ -moooooo - f__ -ab!babababababfoo -ba!ab##abab?bafoo -**!*****_ - ! xxx?xxxxxxxx xxxx xxxxxx xxxxxxx x xxxxxxxxx xx xxxxxx xxxxxx xxxxx xxxxxxx xx xxxx xxxxxxxx xxxx xxxxxxxxxxx xxx xxxxxxx xxxxxxxxx xx xxxxxx xx xxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxx xxx xxxxxxxx xxxxxxxxx xxxx xxx xxxx xxx xxx xxxxx xxxxxxxxxxxx xxxx xxxxxxxxx xxxxxxxxxxx xx xxxxx xxx xxxxxxxx xxxxxx xxx xxx xxxxxxxxx xxxxxxx x xxxxxxxxx xx xxxxxx xxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxx xxx xxx xxxxxxxx xxxxxxx xxxx xxx xxxxxx xxxxx xxxxx xx xxxxxx xxxxxxx xxx xxxxxxxxxxxx xxxx xxxxxxxxx xxxxxx xxxxxx xxxxx xxx xxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxx xxxxxxxxxx xxxx xx xxxxxxxx xxx xxxxxxxxxxx xxxxx --2- -ffo -bob -__ooooo -koooo__ -moooooo - f__ -ab!babababababfoo -ba!ab##abab?bafoo -**!*****_ - ! xxx?xxxxxxxx xxxx xxxxxx xxxxxxx x xxxxxxxxx xx xxxxxx xxxxxx xxxxx xxxxxxx xx xxxx xxxxxxxx xxxx xxxxxxxxxxx xxx xxxxxxx xxxxxxxxx xx xxxxxx xx xxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxx xxx xxxxxxxx xxxxxxxxx xxxx xxx xxxx xxx xxx xxxxx xxxxxxxxxxxx xxxx xxxxxxxxx xxxxxxxxxxx xx xxxxx xxx xxxxxxxx xxxxxx xxx xxx xxxxxxxxx xxxxxxx x xxxxxxxxx xx xxxxxx xxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxx xxx xxx xxxxxxxx xxxxxxx xxxx xxx xxxxxx xxxxx xxxxx xx xxxxxx xxxxxxx xxx xxxxxxxxxxxx xxxx xxxxxxxxx xxxxxx xxxxxx xxxxx xxx xxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxx xxxxxxxxxx xxxx xx xxxxxxxx xxx xxxxxxxxxxx xxxxx -Test -Test END -EN -E -E888 detected for \ze* -E888 detected for \zs*
--- a/src/testdir/test95.in +++ b/src/testdir/test95.in @@ -1,5 +1,5 @@ Test for regexp patterns with multi-byte support, using utf-8. -See test64 for the non-multi-byte tests. +See test_regexp_latin.vim for the non-multi-byte tests. A pattern that gives the expected result produces OK, so that we know it was actually tried.
--- a/src/testdir/test_regexp_latin.vim +++ b/src/testdir/test_regexp_latin.vim @@ -141,3 +141,669 @@ func Test_pattern_compile_speed() call assert_inrange(0.01, 10.0, reltimefloat(reltime(start))) set spc= endfunc + +" Tests for regexp patterns without multi-byte support. +func Test_regexp_single_line_pat() + " tl is a List of Lists with: + " regexp engine + " regexp pattern + " text to test the pattern on + " expected match (optional) + " expected submatch 1 (optional) + " expected submatch 2 (optional) + " etc. + " When there is no match use only the first two items. + let tl = [] + + call add(tl, [2, 'ab', 'aab', 'ab']) + call add(tl, [2, 'b', 'abcdef', 'b']) + call add(tl, [2, 'bc*', 'abccccdef', 'bcccc']) + call add(tl, [2, 'bc\{-}', 'abccccdef', 'b']) + call add(tl, [2, 'bc\{-}\(d\)', 'abccccdef', 'bccccd', 'd']) + call add(tl, [2, 'bc*', 'abbdef', 'b']) + call add(tl, [2, 'c*', 'ccc', 'ccc']) + call add(tl, [2, 'bc*', 'abdef', 'b']) + call add(tl, [2, 'c*', 'abdef', '']) + call add(tl, [2, 'bc\+', 'abccccdef', 'bcccc']) + call add(tl, [2, 'bc\+', 'abdef']) " no match + + " operator \| + call add(tl, [2, 'a\|ab', 'cabd', 'a']) " alternation is ordered + + call add(tl, [2, 'c\?', 'ccb', 'c']) + call add(tl, [2, 'bc\?', 'abd', 'b']) + call add(tl, [2, 'bc\?', 'abccd', 'bc']) + + call add(tl, [2, '\va{1}', 'ab', 'a']) + + call add(tl, [2, '\va{2}', 'aa', 'aa']) + call add(tl, [2, '\va{2}', 'caad', 'aa']) + call add(tl, [2, '\va{2}', 'aba']) + call add(tl, [2, '\va{2}', 'ab']) + call add(tl, [2, '\va{2}', 'abaa', 'aa']) + call add(tl, [2, '\va{2}', 'aaa', 'aa']) + + call add(tl, [2, '\vb{1}', 'abca', 'b']) + call add(tl, [2, '\vba{2}', 'abaa', 'baa']) + call add(tl, [2, '\vba{3}', 'aabaac']) + + call add(tl, [2, '\v(ab){1}', 'ab', 'ab', 'ab']) + call add(tl, [2, '\v(ab){1}', 'dabc', 'ab', 'ab']) + call add(tl, [2, '\v(ab){1}', 'acb']) + + call add(tl, [2, '\v(ab){0,2}', 'acb', "", ""]) + call add(tl, [2, '\v(ab){0,2}', 'ab', 'ab', 'ab']) + call add(tl, [2, '\v(ab){1,2}', 'ab', 'ab', 'ab']) + call add(tl, [2, '\v(ab){1,2}', 'ababc', 'abab', 'ab']) + call add(tl, [2, '\v(ab){2,4}', 'ababcab', 'abab', 'ab']) + call add(tl, [2, '\v(ab){2,4}', 'abcababa', 'abab', 'ab']) + + call add(tl, [2, '\v(ab){2}', 'abab', 'abab', 'ab']) + call add(tl, [2, '\v(ab){2}', 'cdababe', 'abab', 'ab']) + call add(tl, [2, '\v(ab){2}', 'abac']) + call add(tl, [2, '\v(ab){2}', 'abacabab', 'abab', 'ab']) + call add(tl, [2, '\v((ab){2}){2}', 'abababab', 'abababab', 'abab', 'ab']) + call add(tl, [2, '\v((ab){2}){2}', 'abacabababab', 'abababab', 'abab', 'ab']) + + call add(tl, [2, '\v(a{1}){1}', 'a', 'a', 'a']) + call add(tl, [2, '\v(a{2}){1}', 'aa', 'aa', 'aa']) + call add(tl, [2, '\v(a{2}){1}', 'aaac', 'aa', 'aa']) + call add(tl, [2, '\v(a{2}){1}', 'daaac', 'aa', 'aa']) + call add(tl, [2, '\v(a{1}){2}', 'daaac', 'aa', 'a']) + call add(tl, [2, '\v(a{1}){2}', 'aaa', 'aa', 'a']) + call add(tl, [2, '\v(a{2})+', 'adaac', 'aa', 'aa']) + call add(tl, [2, '\v(a{2})+', 'aa', 'aa', 'aa']) + call add(tl, [2, '\v(a{2}){1}', 'aa', 'aa', 'aa']) + call add(tl, [2, '\v(a{1}){2}', 'aa', 'aa', 'a']) + call add(tl, [2, '\v(a{1}){1}', 'a', 'a', 'a']) + call add(tl, [2, '\v(a{2}){2}', 'aaaa', 'aaaa', 'aa']) + call add(tl, [2, '\v(a{2}){2}', 'aaabaaaa', 'aaaa', 'aa']) + + call add(tl, [2, '\v(a+){2}', 'dadaac', 'aa', 'a']) + call add(tl, [2, '\v(a{3}){2}', 'aaaaaaa', 'aaaaaa', 'aaa']) + + call add(tl, [2, '\v(a{1,2}){2}', 'daaac', 'aaa', 'a']) + call add(tl, [2, '\v(a{1,3}){2}', 'daaaac', 'aaaa', 'a']) + call add(tl, [2, '\v(a{1,3}){2}', 'daaaaac', 'aaaaa', 'aa']) + call add(tl, [2, '\v(a{1,3}){3}', 'daac']) + call add(tl, [2, '\v(a{1,2}){2}', 'dac']) + call add(tl, [2, '\v(a+)+', 'daac', 'aa', 'aa']) + call add(tl, [2, '\v(a+)+', 'aaa', 'aaa', 'aaa']) + call add(tl, [2, '\v(a+){1,2}', 'aaa', 'aaa', 'aaa']) + call add(tl, [2, '\v(a+)(a+)', 'aaa', 'aaa', 'aa', 'a']) + call add(tl, [2, '\v(a{3})+', 'daaaac', 'aaa', 'aaa']) + call add(tl, [2, '\v(a|b|c)+', 'aacb', 'aacb', 'b']) + call add(tl, [2, '\v(a|b|c){2}', 'abcb', 'ab', 'b']) + call add(tl, [2, '\v(abc){2}', 'abcabd', ]) + call add(tl, [2, '\v(abc){2}', 'abdabcabc','abcabc', 'abc']) + + call add(tl, [2, 'a*', 'cc', '']) + call add(tl, [2, '\v(a*)+', 'cc', '']) + call add(tl, [2, '\v((ab)+)+', 'ab', 'ab', 'ab', 'ab']) + call add(tl, [2, '\v(((ab)+)+)+', 'ab', 'ab', 'ab', 'ab', 'ab']) + call add(tl, [2, '\v(((ab)+)+)+', 'dababc', 'abab', 'abab', 'abab', 'ab']) + call add(tl, [2, '\v(a{0,2})+', 'cc', '']) + call add(tl, [2, '\v(a*)+', '', '']) + call add(tl, [2, '\v((a*)+)+', '', '']) + call add(tl, [2, '\v((ab)*)+', '', '']) + call add(tl, [2, '\va{1,3}', 'aab', 'aa']) + call add(tl, [2, '\va{2,3}', 'abaa', 'aa']) + + call add(tl, [2, '\v((ab)+|c*)+', 'abcccaba', 'abcccab', '', 'ab']) + call add(tl, [2, '\v(a{2})|(b{3})', 'bbabbbb', 'bbb', '', 'bbb']) + call add(tl, [2, '\va{2}|b{2}', 'abab']) + call add(tl, [2, '\v(a)+|(c)+', 'bbacbaacbbb', 'a', 'a']) + call add(tl, [2, '\vab{2,3}c', 'aabbccccccccccccc', 'abbc']) + call add(tl, [2, '\vab{2,3}c', 'aabbbccccccccccccc', 'abbbc']) + call add(tl, [2, '\vab{2,3}cd{2,3}e', 'aabbbcddee', 'abbbcdde']) + call add(tl, [2, '\va(bc){2}d', 'aabcbfbc' ]) + call add(tl, [2, '\va*a{2}', 'a', ]) + call add(tl, [2, '\va*a{2}', 'aa', 'aa' ]) + call add(tl, [2, '\va*a{2}', 'aaa', 'aaa' ]) + call add(tl, [2, '\va*a{2}', 'bbbabcc', ]) + call add(tl, [2, '\va*b*|a*c*', 'a', 'a']) + call add(tl, [2, '\va{1}b{1}|a{1}b{1}', '']) + + " submatches + call add(tl, [2, '\v(a)', 'ab', 'a', 'a']) + call add(tl, [2, '\v(a)(b)', 'ab', 'ab', 'a', 'b']) + call add(tl, [2, '\v(ab)(b)(c)', 'abbc', 'abbc', 'ab', 'b', 'c']) + call add(tl, [2, '\v((a)(b))', 'ab', 'ab', 'ab', 'a', 'b']) + call add(tl, [2, '\v(a)|(b)', 'ab', 'a', 'a']) + + call add(tl, [2, '\v(a*)+', 'aaaa', 'aaaa', '']) + call add(tl, [2, 'x', 'abcdef']) + + " + " Simple tests + " + + " Search single groups + call add(tl, [2, 'ab', 'aab', 'ab']) + call add(tl, [2, 'ab', 'baced']) + call add(tl, [2, 'ab', ' ab ', 'ab']) + + " Search multi-modifiers + call add(tl, [2, 'x*', 'xcd', 'x']) + call add(tl, [2, 'x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx']) + " empty match is good + call add(tl, [2, 'x*', 'abcdoij', '']) + " no match here + call add(tl, [2, 'x\+', 'abcdoin']) + call add(tl, [2, 'x\+', 'abcdeoijdfxxiuhfij', 'xx']) + call add(tl, [2, 'x\+', 'xxxxx', 'xxxxx']) + call add(tl, [2, 'x\+', 'abc x siufhiush xxxxxxxxx', 'x']) + call add(tl, [2, 'x\=', 'x sdfoij', 'x']) + call add(tl, [2, 'x\=', 'abc sfoij', '']) " empty match is good + call add(tl, [2, 'x\=', 'xxxxxxxxx c', 'x']) + call add(tl, [2, 'x\?', 'x sdfoij', 'x']) + " empty match is good + call add(tl, [2, 'x\?', 'abc sfoij', '']) + call add(tl, [2, 'x\?', 'xxxxxxxxxx c', 'x']) + + call add(tl, [2, 'a\{0,0}', 'abcdfdoij', '']) + " same thing as 'a?' + call add(tl, [2, 'a\{0,1}', 'asiubid axxxaaa', 'a']) + " same thing as 'a\{0,1}' + call add(tl, [2, 'a\{1,0}', 'asiubid axxxaaa', 'a']) + call add(tl, [2, 'a\{3,6}', 'aa siofuh']) + call add(tl, [2, 'a\{3,6}', 'aaaaa asfoij afaa', 'aaaaa']) + call add(tl, [2, 'a\{3,6}', 'aaaaaaaa', 'aaaaaa']) + call add(tl, [2, 'a\{0}', 'asoiuj', '']) + call add(tl, [2, 'a\{2}', 'aaaa', 'aa']) + call add(tl, [2, 'a\{2}', 'iuash fiusahfliusah fiushfilushfi uhsaifuh askfj nasfvius afg aaaa sfiuhuhiushf', 'aa']) + call add(tl, [2, 'a\{2}', 'abcdefghijklmnopqrestuvwxyz1234567890']) + " same thing as 'a*' + call add(tl, [2, 'a\{0,}', 'oij sdigfusnf', '']) + call add(tl, [2, 'a\{0,}', 'aaaaa aa', 'aaaaa']) + call add(tl, [2, 'a\{2,}', 'sdfiougjdsafg']) + call add(tl, [2, 'a\{2,}', 'aaaaasfoij ', 'aaaaa']) + call add(tl, [2, 'a\{5,}', 'xxaaaaxxx ']) + call add(tl, [2, 'a\{5,}', 'xxaaaaaxxx ', 'aaaaa']) + call add(tl, [2, 'a\{,0}', 'oidfguih iuhi hiu aaaa', '']) + call add(tl, [2, 'a\{,5}', 'abcd', 'a']) + call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa']) + " leading star as normal char when \{} follows + call add(tl, [2, '^*\{4,}$', '***']) + call add(tl, [2, '^*\{4,}$', '****', '****']) + call add(tl, [2, '^*\{4,}$', '*****', '*****']) + " same thing as 'a*' + call add(tl, [2, 'a\{}', 'bbbcddiuhfcd', '']) + call add(tl, [2, 'a\{}', 'aaaaioudfh coisf jda', 'aaaa']) + + call add(tl, [2, 'a\{-0,0}', 'abcdfdoij', '']) + " anti-greedy version of 'a?' + call add(tl, [2, 'a\{-0,1}', 'asiubid axxxaaa', '']) + call add(tl, [2, 'a\{-3,6}', 'aa siofuh']) + call add(tl, [2, 'a\{-3,6}', 'aaaaa asfoij afaa', 'aaa']) + call add(tl, [2, 'a\{-3,6}', 'aaaaaaaa', 'aaa']) + call add(tl, [2, 'a\{-0}', 'asoiuj', '']) + call add(tl, [2, 'a\{-2}', 'aaaa', 'aa']) + call add(tl, [2, 'a\{-2}', 'abcdefghijklmnopqrestuvwxyz1234567890']) + call add(tl, [2, 'a\{-0,}', 'oij sdigfusnf', '']) + call add(tl, [2, 'a\{-0,}', 'aaaaa aa', '']) + call add(tl, [2, 'a\{-2,}', 'sdfiougjdsafg']) + call add(tl, [2, 'a\{-2,}', 'aaaaasfoij ', 'aa']) + call add(tl, [2, 'a\{-,0}', 'oidfguih iuhi hiu aaaa', '']) + call add(tl, [2, 'a\{-,5}', 'abcd', '']) + call add(tl, [2, 'a\{-,5}', 'aaaaaaaaaa', '']) + " anti-greedy version of 'a*' + call add(tl, [2, 'a\{-}', 'bbbcddiuhfcd', '']) + call add(tl, [2, 'a\{-}', 'aaaaioudfh coisf jda', '']) + + " Test groups of characters and submatches + call add(tl, [2, '\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc']) + call add(tl, [2, '\(ab\)\+', 'abababaaaaa', 'ababab', 'ab']) + call add(tl, [2, '\(abaaaaa\)*cd', 'cd', 'cd', '']) + call add(tl, [2, '\(test1\)\? \(test2\)\?', 'test1 test3', 'test1 ', 'test1', '']) + call add(tl, [2, '\(test1\)\= \(test2\) \(test4443\)\=', ' test2 test4443 yupiiiiiiiiiii', ' test2 test4443', '', 'test2', 'test4443']) + call add(tl, [2, '\(\(sub1\) hello \(sub 2\)\)', 'asterix sub1 hello sub 2 obelix', 'sub1 hello sub 2', 'sub1 hello sub 2', 'sub1', 'sub 2']) + call add(tl, [2, '\(\(\(yyxxzz\)\)\)', 'abcdddsfiusfyyzzxxyyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz']) + call add(tl, [2, '\v((ab)+|c+)+', 'abcccaba', 'abcccab', 'ab', 'ab']) + call add(tl, [2, '\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab']) + call add(tl, [2, '\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', '']) + call add(tl, [2, '\v(a|b*)+', 'aaaa', 'aaaa', '']) + call add(tl, [2, '\p*', 'aá ', 'aá ']) + + " Test greedy-ness and lazy-ness + call add(tl, [2, 'a\{-2,7}','aaaaaaaaaaaaa', 'aa']) + call add(tl, [2, 'a\{-2,7}x','aaaaaaaaax', 'aaaaaaax']) + call add(tl, [2, 'a\{2,7}','aaaaaaaaaaaaaaaaaaaa', 'aaaaaaa']) + call add(tl, [2, 'a\{2,7}x','aaaaaaaaax', 'aaaaaaax']) + call add(tl, [2, '\vx(.{-,8})yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz','ayxa','xayzxayz']) + call add(tl, [2, '\vx(.*)yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz', 'ayxayzxayzxa','']) + call add(tl, [2, '\v(a{1,2}){-2,3}','aaaaaaa','aaaa','aa']) + call add(tl, [2, '\v(a{-1,3})+', 'aa', 'aa', 'a']) + call add(tl, [2, '^\s\{-}\zs\( x\|x$\)', ' x', ' x', ' x']) + call add(tl, [2, '^\s\{-}\zs\(x\| x$\)', ' x', ' x', ' x']) + call add(tl, [2, '^\s\{-}\ze\(x\| x$\)', ' x', '', ' x']) + call add(tl, [2, '^\(\s\{-}\)\(x\| x$\)', ' x', ' x', '', ' x']) + + " Test Character classes + call add(tl, [2, '\d\+e\d\d','test 10e23 fd','10e23']) + + " Test collections and character range [] + call add(tl, [2, '\v[a]', 'abcd', 'a']) + call add(tl, [2, 'a[bcd]', 'abcd', 'ab']) + call add(tl, [2, 'a[b-d]', 'acbd', 'ac']) + call add(tl, [2, '[a-d][e-f][x-x]d', 'cexdxx', 'cexd']) + call add(tl, [2, '\v[[:alpha:]]+', 'abcdefghijklmnopqrstuvwxyz6','abcdefghijklmnopqrstuvwxyz']) + call add(tl, [2, '[[:alpha:]\+]', '6x8','x']) + call add(tl, [2, '[^abc]\+','abcabcabc']) + call add(tl, [2, '[^abc]','defghiasijvoinasoiunbvb','d']) + call add(tl, [2, '[^abc]\+','ddddddda','ddddddd']) + call add(tl, [2, '[^a-d]\+','aaaAAAZIHFNCddd','AAAZIHFNC']) + call add(tl, [2, '[a-f]*','iiiiiiii','']) + call add(tl, [2, '[a-f]*','abcdefgh','abcdef']) + call add(tl, [2, '[^a-f]\+','abcdefgh','gh']) + call add(tl, [2, '[a-c]\{-3,6}','abcabc','abc']) + call add(tl, [2, '[^[:alpha:]]\+','abcccadfoij7787ysf287yrnccdu','7787']) + call add(tl, [2, '[-a]', '-', '-']) + call add(tl, [2, '[a-]', '-', '-']) + call add(tl, [2, '[a-f]*\c','ABCDEFGH','ABCDEF']) + call add(tl, [2, '[abc][xyz]\c','-af-AF-BY--','BY']) + " filename regexp + call add(tl, [2, '[-./[:alnum:]_~]\+', 'log13.file', 'log13.file']) + " special chars + call add(tl, [2, '[\]\^\-\\]\+', '\^\\\-\---^', '\^\\\-\---^']) + " collation elem + call add(tl, [2, '[[.a.]]\+', 'aa', 'aa']) + " middle of regexp + call add(tl, [2, 'abc[0-9]*ddd', 'siuhabc ii']) + call add(tl, [2, 'abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd']) + call add(tl, [2, '\_[0-9]\+', 'asfi9888u', '9888']) + call add(tl, [2, '[0-9\n]\+', 'asfi9888u', '9888']) + call add(tl, [2, '\_[0-9]\+', "asfi\n9888u", "\n9888"]) + call add(tl, [2, '\_f', " \na ", "\n"]) + call add(tl, [2, '\_f\+', " \na ", "\na"]) + call add(tl, [2, '[0-9A-Za-z-_.]\+', " @0_a.A-{ ", "0_a.A-"]) + + " Test start/end of line, start/end of file + call add(tl, [2, '^a.', "a_\nb ", "a_"]) + call add(tl, [2, '^a.', "b a \na_"]) + call add(tl, [2, '.a$', " a\n "]) + call add(tl, [2, '.a$', " a b\n_a", "_a"]) + call add(tl, [2, '\%^a.', "a a\na", "a "]) + call add(tl, [2, '\%^a', " a \na "]) + call add(tl, [2, '.a\%$', " a\n "]) + call add(tl, [2, '.a\%$', " a\n_a", "_a"]) + + " Test recognition of character classes + call add(tl, [2, '[0-7]\+', 'x0123456789x', '01234567']) + call add(tl, [2, '[^0-7]\+', '0a;X+% 897', 'a;X+% 89']) + call add(tl, [2, '[0-9]\+', 'x0123456789x', '0123456789']) + call add(tl, [2, '[^0-9]\+', '0a;X+% 9', 'a;X+% ']) + call add(tl, [2, '[0-9a-fA-F]\+', 'x0189abcdefg', '0189abcdef']) + call add(tl, [2, '[^0-9A-Fa-f]\+', '0189g;X+% ab', 'g;X+% ']) + call add(tl, [2, '[a-z_A-Z0-9]\+', ';+aso_SfOij ', 'aso_SfOij']) + call add(tl, [2, '[^a-z_A-Z0-9]\+', 'aSo_;+% sfOij', ';+% ']) + call add(tl, [2, '[a-z_A-Z]\+', '0abyz_ABYZ;', 'abyz_ABYZ']) + call add(tl, [2, '[^a-z_A-Z]\+', 'abAB_09;+% yzYZ', '09;+% ']) + call add(tl, [2, '[a-z]\+', '0abcxyz1', 'abcxyz']) + call add(tl, [2, '[a-z]\+', 'AabxyzZ', 'abxyz']) + call add(tl, [2, '[^a-z]\+', 'a;X09+% x', ';X09+% ']) + call add(tl, [2, '[^a-z]\+', 'abX0;%yz', 'X0;%']) + call add(tl, [2, '[a-zA-Z]\+', '0abABxzXZ9', 'abABxzXZ']) + call add(tl, [2, '[^a-zA-Z]\+', 'ab09_;+ XZ', '09_;+ ']) + call add(tl, [2, '[A-Z]\+', 'aABXYZz', 'ABXYZ']) + call add(tl, [2, '[^A-Z]\+', 'ABx0;%YZ', 'x0;%']) + call add(tl, [2, '[a-z]\+\c', '0abxyzABXYZ;', 'abxyzABXYZ']) + call add(tl, [2, '[A-Z]\+\c', '0abABxzXZ9', 'abABxzXZ']) + call add(tl, [2, '\c[^a-z]\+', 'ab09_;+ XZ', '09_;+ ']) + call add(tl, [2, '\c[^A-Z]\+', 'ab09_;+ XZ', '09_;+ ']) + call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa']) + + " Tests for \z features + " match ends at \ze + call add(tl, [2, 'xx \ze test', 'xx ']) + call add(tl, [2, 'abc\zeend', 'oij abcend', 'abc']) + call add(tl, [2, 'aa\zebb\|aaxx', ' aabb ', 'aa']) + call add(tl, [2, 'aa\zebb\|aaxx', ' aaxx ', 'aaxx']) + call add(tl, [2, 'aabb\|aa\zebb', ' aabb ', 'aabb']) + call add(tl, [2, 'aa\zebb\|aaebb', ' aabb ', 'aa']) + " match starts at \zs + call add(tl, [2, 'abc\zsdd', 'ddabcddxyzt', 'dd']) + call add(tl, [2, 'aa \zsax', ' ax']) + call add(tl, [2, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match']) + call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last']) + call add(tl, [2, '\>\zs.', 'aword. ', '.']) + call add(tl, [2, '\s\+\ze\[/\|\s\zs\s\+', 'is [a t', ' ']) + + " Tests for \@= and \& features + call add(tl, [2, 'abc\@=', 'abc', 'ab']) + call add(tl, [2, 'abc\@=cd', 'abcd', 'abcd']) + call add(tl, [2, 'abc\@=', 'ababc', 'ab']) + " will never match, no matter the input text + call add(tl, [2, 'abcd\@=e', 'abcd']) + " will never match + call add(tl, [2, 'abcd\@=e', 'any text in here ... ']) + call add(tl, [2, '\v(abc)@=..', 'xabcd', 'ab', 'abc']) + call add(tl, [2, '\(.*John\)\@=.*Bob', 'here is John, and here is B']) + call add(tl, [2, '\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend']) + call add(tl, [2, '\<\S\+\())\)\@=', '$((i=i+1))', 'i=i+1', '))']) + call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B']) + call add(tl, [2, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob']) + call add(tl, [2, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1']) + call add(tl, [2, 'foo\(bar\)\@!', 'foobar']) + call add(tl, [2, 'foo\(bar\)\@!', 'foo bar', 'foo']) + call add(tl, [2, 'if \(\(then\)\@!.\)*$', ' if then else']) + call add(tl, [2, 'if \(\(then\)\@!.\)*$', ' if else ', 'if else ', ' ']) + call add(tl, [2, '\(foo\)\@!bar', 'foobar', 'bar']) + call add(tl, [2, '\(foo\)\@!...bar', 'foobar']) + call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' bar foo ']) + call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' foo bar ']) + call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' foo xxx ', 'foo']) + call add(tl, [2, '[ ]\@!\p\%([ ]\@!\p\)*:', 'implicit mappings:', 'mappings:']) + call add(tl, [2, '[ ]\@!\p\([ ]\@!\p\)*:', 'implicit mappings:', 'mappings:', 's']) + call add(tl, [2, 'm\k\+_\@=\%(_\@!\k\)\@<=\k\+e', 'mx__xe', 'mx__xe']) + call add(tl, [2, '\%(\U\@<=S\k*\|S\l\)R', 'SuR', 'SuR']) + + " Combining different tests and features + call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab']) + call add(tl, [2, '', 'abcd', '']) + call add(tl, [2, '\v(())', 'any possible text', '']) + call add(tl, [2, '\v%(ab(xyz)c)', ' abxyzc ', 'abxyzc', 'xyz']) + call add(tl, [2, '\v(test|)empty', 'tesempty', 'empty', '']) + call add(tl, [2, '\v(a|aa)(a|aa)', 'aaa', 'aa', 'a', 'a']) + + " \%u and friends + call add(tl, [2, '\%d32', 'yes no', ' ']) + call add(tl, [2, '\%o40', 'yes no', ' ']) + call add(tl, [2, '\%x20', 'yes no', ' ']) + call add(tl, [2, '\%u0020', 'yes no', ' ']) + call add(tl, [2, '\%U00000020', 'yes no', ' ']) + call add(tl, [2, '\%d0', "yes\x0ano", "\x0a"]) + + "" \%[abc] + call add(tl, [2, 'foo\%[bar]', 'fobar']) + call add(tl, [2, 'foo\%[bar]', 'foobar', 'foobar']) + call add(tl, [2, 'foo\%[bar]', 'fooxx', 'foo']) + call add(tl, [2, 'foo\%[bar]', 'foobxx', 'foob']) + call add(tl, [2, 'foo\%[bar]', 'foobaxx', 'fooba']) + call add(tl, [2, 'foo\%[bar]', 'foobarxx', 'foobar']) + call add(tl, [2, 'foo\%[bar]x', 'foobxx', 'foobx']) + call add(tl, [2, 'foo\%[bar]x', 'foobarxx', 'foobarx']) + call add(tl, [2, '\%[bar]x', 'barxx', 'barx']) + call add(tl, [2, '\%[bar]x', 'bxx', 'bx']) + call add(tl, [2, '\%[bar]x', 'xxx', 'x']) + call add(tl, [2, 'b\%[[ao]r]', 'bar bor', 'bar']) + call add(tl, [2, 'b\%[[]]r]', 'b]r bor', 'b]r']) + call add(tl, [2, '@\%[\w\-]*', '<http://john.net/pandoc/>[@pandoc]', '@pandoc']) + + " Alternatives, must use first longest match + call add(tl, [2, 'goo\|go', 'google', 'goo']) + call add(tl, [2, '\<goo\|\<go', 'google', 'goo']) + call add(tl, [2, '\<goo\|go', 'google', 'goo']) + + " Back references + call add(tl, [2, '\(\i\+\) \1', ' abc abc', 'abc abc', 'abc']) + call add(tl, [2, '\(\i\+\) \1', 'xgoo goox', 'goo goo', 'goo']) + call add(tl, [2, '\(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9', 'xabcddefghiabcddefghix', 'abcddefghiabcddefghi', 'a', 'b', 'c', 'dd', 'e', 'f', 'g', 'h', 'i']) + call add(tl, [2, '\(\d*\)a \1b', ' a b ', 'a b', '']) + call add(tl, [2, '^.\(.\).\_..\1.', "aaa\naaa\nb", "aaa\naaa", 'a']) + call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<!$', 'foo.bat/foo.com', 'foo.bat/foo.com', 'bat']) + call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<!$', 'foo.bat/foo.bat']) + call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<=$', 'foo.bat/foo.bat', 'foo.bat/foo.bat', 'bat', 'bat']) + call add(tl, [2, '\\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}', '2013-06-27${0}', '${0}', '0']) + call add(tl, [2, '^\(a*\)\1$', 'aaaaaaaa', 'aaaaaaaa', 'aaaa']) + call add(tl, [2, '^\(a\{-2,}\)\1\+$', 'aaaaaaaaa', 'aaaaaaaaa', 'aaa']) + + " Look-behind with limit + call add(tl, [2, '<\@<=span.', 'xxspanxx<spanyyy', 'spany']) + call add(tl, [2, '<\@1<=span.', 'xxspanxx<spanyyy', 'spany']) + call add(tl, [2, '<\@2<=span.', 'xxspanxx<spanyyy', 'spany']) + call add(tl, [2, '\(<<\)\@<=span.', 'xxspanxxxx<spanxx<<spanyyy', 'spany', '<<']) + call add(tl, [2, '\(<<\)\@1<=span.', 'xxspanxxxx<spanxx<<spanyyy']) + call add(tl, [2, '\(<<\)\@2<=span.', 'xxspanxxxx<spanxx<<spanyyy', 'spany', '<<']) + call add(tl, [2, '\(foo\)\@<!bar.', 'xx foobar1 xbar2 xx', 'bar2']) + + " look-behind match in front of a zero-width item + call add(tl, [2, '\v\C%(<Last Changed:\s+)@<=.*$', '" test header']) + call add(tl, [2, '\v\C%(<Last Changed:\s+)@<=.*$', '" Last Changed: 1970', '1970']) + call add(tl, [2, '\(foo\)\@<=\>', 'foobar']) + call add(tl, [2, '\(foo\)\@<=\>', 'barfoo', '', 'foo']) + call add(tl, [2, '\(foo\)\@<=.*', 'foobar', 'bar', 'foo']) + + " complicated look-behind match + call add(tl, [2, '\(r\@<=\|\w\@<!\)\/', 'x = /word/;', '/']) + call add(tl, [2, '^[a-z]\+\ze \&\(asdf\)\@<!', 'foo bar', 'foo']) + + "" \@> + call add(tl, [2, '\(a*\)\@>a', 'aaaa']) + call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa']) + call add(tl, [2, '^\(.\{-}b\)\@>.', ' abcbd', ' abc', ' ab']) + call add(tl, [2, '\(.\{-}\)\(\)\@>$', 'abc', 'abc', 'abc', '']) + " TODO: BT engine does not restore submatch after failure + call add(tl, [1, '\(a*\)\@>a\|a\+', 'aaaa', 'aaaa']) + + " "\_" prepended negated collection matches EOL + call add(tl, [2, '\_[^8-9]\+', "asfi\n9888", "asfi\n"]) + call add(tl, [2, '\_[^a]\+', "asfi\n9888", "sfi\n9888"]) + + " Requiring lots of states. + call add(tl, [2, '[0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12}', " 12345678-1234-1234-1234-123456789012 ", "12345678-1234-1234-1234-123456789012", "1234-"]) + + " Skip adding state twice + call add(tl, [2, '^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=', "#if FOO", "#if", ' FOO']) + + " Test \%V atom + call add(tl, [2, '\%>70vGesamt', 'Jean-Michel Charlier & Victor Hubinon\Gesamtausgabe [Salleck] Buck Danny {Jean-Michel Charlier & Victor Hubinon}\Gesamtausgabe', 'Gesamt']) + + " Run the tests + for t in tl + let re = t[0] + let pat = t[1] + let text = t[2] + let matchidx = 3 + for engine in [0, 1, 2] + if engine == 2 && re == 0 || engine == 1 && re == 1 + continue + endif + let ®expengine = engine + try + let l = matchlist(text, pat) + catch + call assert_report('Error ' . engine . ': pat: \"' . pat + \ . '\", text: \"' . text . '\", caused an exception: \"' + \ . v:exception . '\"') + endtry + " check the match itself + if len(l) == 0 && len(t) > matchidx + call assert_report('Error ' . engine . ': pat: \"' . pat + \ . '\", text: \"' . text . '\", did not match, expected: \"' + \ . t[matchidx] . '\"') + elseif len(l) > 0 && len(t) == matchidx + call assert_report('Error ' . engine . ': pat: \"' . pat + \ . '\", text: \"' . text . '\", match: \"' . l[0] + \ . '\", expected no match') + elseif len(t) > matchidx && l[0] != t[matchidx] + call assert_report('Error ' . engine . ': pat: \"' . pat + \ . '\", text: \"' . text . '\", match: \"' . l[0] + \ . '\", expected: \"' . t[matchidx] . '\"') + else + " Test passed + endif + + " check all the nine submatches + if len(l) > 0 + for i in range(1, 9) + if len(t) <= matchidx + i + let e = '' + else + let e = t[matchidx + i] + endif + if l[i] != e + call assert_report('Error ' . engine . ': pat: \"' . pat + \ . '\", text: \"' . text . '\", submatch ' . i . ': \"' + \ . l[i] . '\", expected: \"' . e . '\"') + endif + endfor + unlet i + endif + endfor + endfor + + unlet t tl e l +endfunc + +" Tests for multi-line regexp patterns without multi-byte support. +func Test_regexp_multiline_pat() + let tl = [] + + " back references + call add(tl, [2, '^.\(.\).\_..\1.', ['aaa', 'aaa', 'b'], ['XX', 'b']]) + call add(tl, [2, '\v.*\/(.*)\n.*\/\1$', ['./Dir1/Dir2/zyxwvuts.txt', './Dir1/Dir2/abcdefgh.bat', '', './Dir1/Dir2/file1.txt', './OtherDir1/OtherDir2/file1.txt'], ['./Dir1/Dir2/zyxwvuts.txt', './Dir1/Dir2/abcdefgh.bat', '', 'XX']]) + + " line breaks + call add(tl, [2, '\S.*\nx', ['abc', 'def', 'ghi', 'xjk', 'lmn'], ['abc', 'def', 'XXjk', 'lmn']]) + + " Check that \_[0-9] matching EOL does not break a following \> + call add(tl, [2, '\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\>', ['', 'localnet/192.168.0.1', ''], ['', 'localnet/XX', '']]) + + " Check a pattern with a line break and ^ and $ + call add(tl, [2, 'a\n^b$\n^c', ['a', 'b', 'c'], ['XX']]) + + call add(tl, [2, '\(^.\+\n\)\1', [' dog', ' dog', 'asdf'], ['XXasdf']]) + + " Run the multi-line tests + for t in tl + let re = t[0] + let pat = t[1] + let before = t[2] + let after = t[3] + for engine in [0, 1, 2] + if engine == 2 && re == 0 || engine == 1 && re ==1 + continue + endif + let ®expengine = engine + new + call setline(1, before) + exe '%s/' . pat . '/XX/' + let result = getline(1, '$') + q! + if result != after + call assert_report('Error: pat: \"' . pat . '\", text: \"' + \ . string(before) . '\", expected: \"' . string(after) + \ . '\", got: \"' . string(result) . '\"') + else + " Test passed + endif + endfor + endfor + unlet t tl +endfunc + +" Check that using a pattern on two lines doesn't get messed up by using +" matchstr() with \ze in between. +func Test_matchstr_with_ze() + new + call append(0, ['Substitute here:', '<T="">Ta 5</Title>', + \ '<T="">Ac 7</Title>']) + call cursor(1, 1) + set re=0 + + .+1,.+2s/""/\='"' . matchstr(getline("."), '\d\+\ze<') . '"' + call assert_equal(['Substitute here:', '<T="5">Ta 5</Title>', + \ '<T="7">Ac 7</Title>', ''], getline(1, '$')) + + bwipe! +endfunc + +" Check a pattern with a look beind crossing a line boundary +func Test_lookbehind_across_line() + new + call append(0, ['Behind:', 'asdfasd<yyy', 'xxstart1', 'asdfasd<yy', + \ 'xxxstart2', 'asdfasd<yy', 'xxstart3']) + call cursor(1, 1) + call search('\(<\_[xy]\+\)\@3<=start') + call assert_equal([0, 7, 3, 0], getpos('.')) + bwipe! +endfunc + +" Check matching Visual area +func Test_matching_visual_area() + new + call append(0, ['Visual:', 'thexe the thexethe', 'andaxand andaxand', + \ 'oooxofor foroxooo', 'oooxofor foroxooo']) + call cursor(1, 1) + exe "normal jfxvfx:s/\\%Ve/E/g\<CR>" + exe "normal jV:s/\\%Va/A/g\<CR>" + exe "normal jfx\<C-V>fxj:s/\\%Vo/O/g\<CR>" + call assert_equal(['Visual:', 'thexE thE thExethe', 'AndAxAnd AndAxAnd', + \ 'oooxOfOr fOrOxooo', 'oooxOfOr fOrOxooo', ''], getline(1, '$')) + bwipe! +endfunc + +" Check matching marks +func Test_matching_marks() + new + call append(0, ['', '', '', 'Marks:', 'asdfSasdfsadfEasdf', 'asdfSas', + \ 'dfsadfEasdf', '', '', '', '', '']) + call cursor(4, 1) + exe "normal jfSmsfEme:.-4,.+6s/.\\%>'s.*\\%<'e../here/\<CR>" + exe "normal jfSmsj0fEme:.-4,.+6s/.\\%>'s\\_.*\\%<'e../again/\<CR>" + call assert_equal(['', '', '', 'Marks:', 'asdfhereasdf', 'asdfagainasdf', + \ '', '', '', '', '', ''], getline(1, '$')) + bwipe! +endfunc + +" Check patterns matching cursor position. +func s:curpos_test() + new + call setline(1, ['ffooooo', 'boboooo', 'zoooooo', 'koooooo', 'moooooo', + \ "\t\t\tfoo", 'abababababababfoo', 'bababababababafoo', '********_', + \ ' xxxxxxxxxxxx xxxx xxxxxx xxxxxxx x xxxxxxxxx xx xxxxxx xxxxxx xxxxx xxxxxxx xx xxxx xxxxxxxx xxxx xxxxxxxxxxx xxx xxxxxxx xxxxxxxxx xx xxxxxx xx xxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxx xxx xxxxxxxx xxxxxxxxx xxxx xxx xxxx xxx xxx xxxxx xxxxxxxxxxxx xxxx xxxxxxxxx xxxxxxxxxxx xx xxxxx xxx xxxxxxxx xxxxxx xxx xxx xxxxxxxxx xxxxxxx x xxxxxxxxx xx xxxxxx xxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxx xxx xxx xxxxxxxx xxxxxxx xxxx xxx xxxxxx xxxxx xxxxx xx xxxxxx xxxxxxx xxx xxxxxxxxxxxx xxxx xxxxxxxxx xxxxxx xxxxxx xxxxx xxx xxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxx xxxxxxxxxx xxxx xx xxxxxxxx xxx xxxxxxxxxxx xxxxx']) + call setpos('.', [0, 1, 0, 0]) + s/\%>3c.//g + call setpos('.', [0, 2, 4, 0]) + s/\%#.*$//g + call setpos('.', [0, 3, 0, 0]) + s/\%<3c./_/g + %s/\%4l\%>5c./_/g + %s/\%6l\%>25v./_/g + %s/\%>6l\%3c./!/g + %s/\%>7l\%12c./?/g + %s/\%>7l\%<9l\%>5v\%<8v./#/g + $s/\%(|\u.*\)\@<=[^|\t]\+$//ge + call assert_equal(['ffo', 'bob', '__ooooo', 'koooo__', 'moooooo', + \ ' f__', 'ab!babababababfoo', + \ 'ba!ab##abab?bafoo', '**!*****_', + \ ' ! xxx?xxxxxxxx xxxx xxxxxx xxxxxxx x xxxxxxxxx xx xxxxxx xxxxxx xxxxx xxxxxxx xx xxxx xxxxxxxx xxxx xxxxxxxxxxx xxx xxxxxxx xxxxxxxxx xx xxxxxx xx xxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxx xxx xxxxxxxx xxxxxxxxx xxxx xxx xxxx xxx xxx xxxxx xxxxxxxxxxxx xxxx xxxxxxxxx xxxxxxxxxxx xx xxxxx xxx xxxxxxxx xxxxxx xxx xxx xxxxxxxxx xxxxxxx x xxxxxxxxx xx xxxxxx xxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxx xxx xxx xxxxxxxx xxxxxxx xxxx xxx xxxxxx xxxxx xxxxx xx xxxxxx xxxxxxx xxx xxxxxxxxxxxx xxxx xxxxxxxxx xxxxxx xxxxxx xxxxx xxx xxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxx xxxxxxxxxx xxxx xx xxxxxxxx xxx xxxxxxxxxxx xxxxx'], + \ getline(1, '$')) + bwipe! +endfunc + +func Test_matching_curpos() + set re=0 + call s:curpos_test() + set re=1 + call s:curpos_test() + set re=2 + call s:curpos_test() + set re& +endfunc + +" Test for matching the start and end of a buffer +func Test_start_end_of_buffer_match() + new + call setline(1, repeat(['vim edit'], 20)) + /\%^ + call assert_equal([0, 1, 1, 0], getpos('.')) + exe "normal 50%/\\%^..\<CR>" + call assert_equal([0, 1, 1, 0], getpos('.')) + exe "normal 50%/\\%$\<CR>" + call assert_equal([0, 20, 8, 0], getpos('.')) + exe "normal 6gg/..\\%$\<CR>" + call assert_equal([0, 20, 7, 0], getpos('.')) + bwipe! +endfunc + +" Check for detecting error +func Test_regexp_error() + set regexpengine=2 + call assert_fails("call matchlist('x x', ' \\ze*')", 'E888:') + call assert_fails("call matchlist('x x', ' \\zs*')", 'E888:') + set re& +endfunc + +" vim: shiftwidth=2 sts=2 expandtab