annotate src/testdir/test64.in @ 9649:fd9727ae3c49 v7.4.2101

commit https://github.com/vim/vim/commit/2932359000b2f918d5fade79ea4d124d5943cd07 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 24 22:04:11 2016 +0200 patch 7.4.2101 Problem: Looping over windows, buffers and tab pages is inconsistant. Solution: Use FOR_ALL_ macros everywhere. (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Sun, 24 Jul 2016 22:15:07 +0200
parents 3666915cac0b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
1 Test for regexp patterns without multi-byte support.
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
2 See test95 for multi-byte tests.
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
3
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
4 A pattern that gives the expected result produces OK, so that we know it was
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
5 actually tried.
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
6
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
7 STARTTEST
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
8 :so small.vim
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
9 :" tl is a List of Lists with:
6510
dfd593d81818 updated for version 7.4.582
Bram Moolenaar <bram@vim.org>
parents: 6170
diff changeset
10 :" regexp engine
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
11 :" regexp pattern
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
12 :" text to test the pattern on
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
13 :" expected match (optional)
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
14 :" expected submatch 1 (optional)
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
15 :" expected submatch 2 (optional)
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
16 :" etc.
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
17 :" When there is no match use only the first two items.
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
18 :let tl = []
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
19 :"
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
20 :""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
21 :"""" Previously written tests """"""""""""""""""""""""""""""""
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
22 :""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
23 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
24 :call add(tl, [2, 'ab', 'aab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
25 :call add(tl, [2, 'b', 'abcdef', 'b'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
26 :call add(tl, [2, 'bc*', 'abccccdef', 'bcccc'])
4675
811a4c9b51d8 updated for version 7.3.1085
Bram Moolenaar <bram@vim.org>
parents: 4673
diff changeset
27 :call add(tl, [2, 'bc\{-}', 'abccccdef', 'b'])
811a4c9b51d8 updated for version 7.3.1085
Bram Moolenaar <bram@vim.org>
parents: 4673
diff changeset
28 :call add(tl, [2, 'bc\{-}\(d\)', 'abccccdef', 'bccccd', 'd'])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
29 :call add(tl, [2, 'bc*', 'abbdef', 'b'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
30 :call add(tl, [2, 'c*', 'ccc', 'ccc'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
31 :call add(tl, [2, 'bc*', 'abdef', 'b'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
32 :call add(tl, [2, 'c*', 'abdef', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
33 :call add(tl, [2, 'bc\+', 'abccccdef', 'bcccc'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
34 :call add(tl, [2, 'bc\+', 'abdef']) "no match
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
35 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
36 :"operator \|
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
37 :call add(tl, [2, 'a\|ab', 'cabd', 'a']) "alternation is ordered
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
38 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
39 :call add(tl, [2, 'c\?', 'ccb', 'c'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
40 :call add(tl, [2, 'bc\?', 'abd', 'b'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
41 :call add(tl, [2, 'bc\?', 'abccd', 'bc'])
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
42 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
43 :call add(tl, [2, '\va{1}', 'ab', 'a'])
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
44 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
45 :call add(tl, [2, '\va{2}', 'aa', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
46 :call add(tl, [2, '\va{2}', 'caad', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
47 :call add(tl, [2, '\va{2}', 'aba'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
48 :call add(tl, [2, '\va{2}', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
49 :call add(tl, [2, '\va{2}', 'abaa', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
50 :call add(tl, [2, '\va{2}', 'aaa', 'aa'])
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
51 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
52 :call add(tl, [2, '\vb{1}', 'abca', 'b'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
53 :call add(tl, [2, '\vba{2}', 'abaa', 'baa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
54 :call add(tl, [2, '\vba{3}', 'aabaac'])
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
55 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
56 :call add(tl, [2, '\v(ab){1}', 'ab', 'ab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
57 :call add(tl, [2, '\v(ab){1}', 'dabc', 'ab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
58 :call add(tl, [2, '\v(ab){1}', 'acb'])
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
59 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
60 :call add(tl, [2, '\v(ab){0,2}', 'acb', "", ""])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
61 :call add(tl, [2, '\v(ab){0,2}', 'ab', 'ab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
62 :call add(tl, [2, '\v(ab){1,2}', 'ab', 'ab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
63 :call add(tl, [2, '\v(ab){1,2}', 'ababc', 'abab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
64 :call add(tl, [2, '\v(ab){2,4}', 'ababcab', 'abab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
65 :call add(tl, [2, '\v(ab){2,4}', 'abcababa', 'abab', 'ab'])
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
66 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
67 :call add(tl, [2, '\v(ab){2}', 'abab', 'abab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
68 :call add(tl, [2, '\v(ab){2}', 'cdababe', 'abab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
69 :call add(tl, [2, '\v(ab){2}', 'abac'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
70 :call add(tl, [2, '\v(ab){2}', 'abacabab', 'abab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
71 :call add(tl, [2, '\v((ab){2}){2}', 'abababab', 'abababab', 'abab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
72 :call add(tl, [2, '\v((ab){2}){2}', 'abacabababab', 'abababab', 'abab', 'ab'])
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
73 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
74 :call add(tl, [2, '\v(a{1}){1}', 'a', 'a', 'a'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
75 :call add(tl, [2, '\v(a{2}){1}', 'aa', 'aa', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
76 :call add(tl, [2, '\v(a{2}){1}', 'aaac', 'aa', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
77 :call add(tl, [2, '\v(a{2}){1}', 'daaac', 'aa', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
78 :call add(tl, [2, '\v(a{1}){2}', 'daaac', 'aa', 'a'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
79 :call add(tl, [2, '\v(a{1}){2}', 'aaa', 'aa', 'a'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
80 :call add(tl, [2, '\v(a{2})+', 'adaac', 'aa', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
81 :call add(tl, [2, '\v(a{2})+', 'aa', 'aa', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
82 :call add(tl, [2, '\v(a{2}){1}', 'aa', 'aa', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
83 :call add(tl, [2, '\v(a{1}){2}', 'aa', 'aa', 'a'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
84 :call add(tl, [2, '\v(a{1}){1}', 'a', 'a', 'a'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
85 :call add(tl, [2, '\v(a{2}){2}', 'aaaa', 'aaaa', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
86 :call add(tl, [2, '\v(a{2}){2}', 'aaabaaaa', 'aaaa', 'aa'])
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
87 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
88 :call add(tl, [2, '\v(a+){2}', 'dadaac', 'aa', 'a'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
89 :call add(tl, [2, '\v(a{3}){2}', 'aaaaaaa', 'aaaaaa', 'aaa'])
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
90 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
91 :call add(tl, [2, '\v(a{1,2}){2}', 'daaac', 'aaa', 'a'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
92 :call add(tl, [2, '\v(a{1,3}){2}', 'daaaac', 'aaaa', 'a'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
93 :call add(tl, [2, '\v(a{1,3}){2}', 'daaaaac', 'aaaaa', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
94 :call add(tl, [2, '\v(a{1,3}){3}', 'daac'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
95 :call add(tl, [2, '\v(a{1,2}){2}', 'dac'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
96 :call add(tl, [2, '\v(a+)+', 'daac', 'aa', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
97 :call add(tl, [2, '\v(a+)+', 'aaa', 'aaa', 'aaa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
98 :call add(tl, [2, '\v(a+){1,2}', 'aaa', 'aaa', 'aaa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
99 :call add(tl, [2, '\v(a+)(a+)', 'aaa', 'aaa', 'aa', 'a'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
100 :call add(tl, [2, '\v(a{3})+', 'daaaac', 'aaa', 'aaa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
101 :call add(tl, [2, '\v(a|b|c)+', 'aacb', 'aacb', 'b'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
102 :call add(tl, [2, '\v(a|b|c){2}', 'abcb', 'ab', 'b'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
103 :call add(tl, [2, '\v(abc){2}', 'abcabd', ])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
104 :call add(tl, [2, '\v(abc){2}', 'abdabcabc','abcabc', 'abc'])
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
105 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
106 :call add(tl, [2, 'a*', 'cc', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
107 :call add(tl, [2, '\v(a*)+', 'cc', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
108 :call add(tl, [2, '\v((ab)+)+', 'ab', 'ab', 'ab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
109 :call add(tl, [2, '\v(((ab)+)+)+', 'ab', 'ab', 'ab', 'ab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
110 :call add(tl, [2, '\v(((ab)+)+)+', 'dababc', 'abab', 'abab', 'abab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
111 :call add(tl, [2, '\v(a{0,2})+', 'cc', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
112 :call add(tl, [2, '\v(a*)+', '', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
113 :call add(tl, [2, '\v((a*)+)+', '', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
114 :call add(tl, [2, '\v((ab)*)+', '', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
115 :call add(tl, [2, '\va{1,3}', 'aab', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
116 :call add(tl, [2, '\va{2,3}', 'abaa', 'aa'])
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
117 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
118 :call add(tl, [2, '\v((ab)+|c*)+', 'abcccaba', 'abcccab', '', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
119 :call add(tl, [2, '\v(a{2})|(b{3})', 'bbabbbb', 'bbb', '', 'bbb'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
120 :call add(tl, [2, '\va{2}|b{2}', 'abab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
121 :call add(tl, [2, '\v(a)+|(c)+', 'bbacbaacbbb', 'a', 'a'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
122 :call add(tl, [2, '\vab{2,3}c', 'aabbccccccccccccc', 'abbc'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
123 :call add(tl, [2, '\vab{2,3}c', 'aabbbccccccccccccc', 'abbbc'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
124 :call add(tl, [2, '\vab{2,3}cd{2,3}e', 'aabbbcddee', 'abbbcdde'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
125 :call add(tl, [2, '\va(bc){2}d', 'aabcbfbc' ])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
126 :call add(tl, [2, '\va*a{2}', 'a', ])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
127 :call add(tl, [2, '\va*a{2}', 'aa', 'aa' ])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
128 :call add(tl, [2, '\va*a{2}', 'aaa', 'aaa' ])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
129 :call add(tl, [2, '\va*a{2}', 'bbbabcc', ])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
130 :call add(tl, [2, '\va*b*|a*c*', 'a', 'a'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
131 :call add(tl, [2, '\va{1}b{1}|a{1}b{1}', ''])
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
132 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
133 :"submatches
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
134 :call add(tl, [2, '\v(a)', 'ab', 'a', 'a'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
135 :call add(tl, [2, '\v(a)(b)', 'ab', 'ab', 'a', 'b'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
136 :call add(tl, [2, '\v(ab)(b)(c)', 'abbc', 'abbc', 'ab', 'b', 'c'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
137 :call add(tl, [2, '\v((a)(b))', 'ab', 'ab', 'ab', 'a', 'b'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
138 :call add(tl, [2, '\v(a)|(b)', 'ab', 'a', 'a'])
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
139 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
140 :call add(tl, [2, '\v(a*)+', 'aaaa', 'aaaa', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
141 :call add(tl, [2, 'x', 'abcdef'])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
142 :"
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
143 :""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
144 :""""" Simple tests """""""""""""""""""""""""""""""""""""""""""
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
145 :""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
146 :"
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
147 :" Search single groups
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
148 :call add(tl, [2, 'ab', 'aab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
149 :call add(tl, [2, 'ab', 'baced'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
150 :call add(tl, [2, 'ab', ' ab ', 'ab'])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
151 :"
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
152 :" Search multi-modifiers
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
153 :call add(tl, [2, 'x*', 'xcd', 'x'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
154 :call add(tl, [2, 'x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx'])
4569
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
155 :" empty match is good
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
156 :call add(tl, [2, 'x*', 'abcdoij', ''])
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
157 :" no match here
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
158 :call add(tl, [2, 'x\+', 'abcdoin'])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
159 :call add(tl, [2, 'x\+', 'abcdeoijdfxxiuhfij', 'xx'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
160 :call add(tl, [2, 'x\+', 'xxxxx', 'xxxxx'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
161 :call add(tl, [2, 'x\+', 'abc x siufhiush xxxxxxxxx', 'x'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
162 :call add(tl, [2, 'x\=', 'x sdfoij', 'x'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
163 :call add(tl, [2, 'x\=', 'abc sfoij', '']) " empty match is good
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
164 :call add(tl, [2, 'x\=', 'xxxxxxxxx c', 'x'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
165 :call add(tl, [2, 'x\?', 'x sdfoij', 'x'])
4569
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
166 :" empty match is good
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
167 :call add(tl, [2, 'x\?', 'abc sfoij', ''])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
168 :call add(tl, [2, 'x\?', 'xxxxxxxxxx c', 'x'])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
169 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
170 :call add(tl, [2, 'a\{0,0}', 'abcdfdoij', ''])
4569
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
171 :" same thing as 'a?'
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
172 :call add(tl, [2, 'a\{0,1}', 'asiubid axxxaaa', 'a'])
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
173 :" same thing as 'a\{0,1}'
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
174 :call add(tl, [2, 'a\{1,0}', 'asiubid axxxaaa', 'a'])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
175 :call add(tl, [2, 'a\{3,6}', 'aa siofuh'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
176 :call add(tl, [2, 'a\{3,6}', 'aaaaa asfoij afaa', 'aaaaa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
177 :call add(tl, [2, 'a\{3,6}', 'aaaaaaaa', 'aaaaaa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
178 :call add(tl, [2, 'a\{0}', 'asoiuj', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
179 :call add(tl, [2, 'a\{2}', 'aaaa', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
180 :call add(tl, [2, 'a\{2}', 'iuash fiusahfliusah fiushfilushfi uhsaifuh askfj nasfvius afg aaaa sfiuhuhiushf', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
181 :call add(tl, [2, 'a\{2}', 'abcdefghijklmnopqrestuvwxyz1234567890'])
4569
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
182 :" same thing as 'a*'
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
183 :call add(tl, [2, 'a\{0,}', 'oij sdigfusnf', ''])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
184 :call add(tl, [2, 'a\{0,}', 'aaaaa aa', 'aaaaa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
185 :call add(tl, [2, 'a\{2,}', 'sdfiougjdsafg'])
4673
05d57d7c2d55 updated for version 7.3.1084
Bram Moolenaar <bram@vim.org>
parents: 4671
diff changeset
186 :call add(tl, [2, 'a\{2,}', 'aaaaasfoij ', 'aaaaa'])
05d57d7c2d55 updated for version 7.3.1084
Bram Moolenaar <bram@vim.org>
parents: 4671
diff changeset
187 :call add(tl, [2, 'a\{5,}', 'xxaaaaxxx '])
05d57d7c2d55 updated for version 7.3.1084
Bram Moolenaar <bram@vim.org>
parents: 4671
diff changeset
188 :call add(tl, [2, 'a\{5,}', 'xxaaaaaxxx ', 'aaaaa'])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
189 :call add(tl, [2, 'a\{,0}', 'oidfguih iuhi hiu aaaa', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
190 :call add(tl, [2, 'a\{,5}', 'abcd', 'a'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
191 :call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa'])
4679
4d92b873acef updated for version 7.3.1087
Bram Moolenaar <bram@vim.org>
parents: 4677
diff changeset
192 :" leading star as normal char when \{} follows
4d92b873acef updated for version 7.3.1087
Bram Moolenaar <bram@vim.org>
parents: 4677
diff changeset
193 :call add(tl, [2, '^*\{4,}$', '***'])
4d92b873acef updated for version 7.3.1087
Bram Moolenaar <bram@vim.org>
parents: 4677
diff changeset
194 :call add(tl, [2, '^*\{4,}$', '****', '****'])
4d92b873acef updated for version 7.3.1087
Bram Moolenaar <bram@vim.org>
parents: 4677
diff changeset
195 :call add(tl, [2, '^*\{4,}$', '*****', '*****'])
4569
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
196 :" same thing as 'a*'
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
197 :call add(tl, [2, 'a\{}', 'bbbcddiuhfcd', ''])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
198 :call add(tl, [2, 'a\{}', 'aaaaioudfh coisf jda', 'aaaa'])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
199 :"
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
200 :call add(tl, [2, 'a\{-0,0}', 'abcdfdoij', ''])
4569
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
201 :" anti-greedy version of 'a?'
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
202 :call add(tl, [2, 'a\{-0,1}', 'asiubid axxxaaa', ''])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
203 :call add(tl, [2, 'a\{-3,6}', 'aa siofuh'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
204 :call add(tl, [2, 'a\{-3,6}', 'aaaaa asfoij afaa', 'aaa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
205 :call add(tl, [2, 'a\{-3,6}', 'aaaaaaaa', 'aaa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
206 :call add(tl, [2, 'a\{-0}', 'asoiuj', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
207 :call add(tl, [2, 'a\{-2}', 'aaaa', 'aa'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
208 :call add(tl, [2, 'a\{-2}', 'abcdefghijklmnopqrestuvwxyz1234567890'])
4675
811a4c9b51d8 updated for version 7.3.1085
Bram Moolenaar <bram@vim.org>
parents: 4673
diff changeset
209 :call add(tl, [2, 'a\{-0,}', 'oij sdigfusnf', ''])
811a4c9b51d8 updated for version 7.3.1085
Bram Moolenaar <bram@vim.org>
parents: 4673
diff changeset
210 :call add(tl, [2, 'a\{-0,}', 'aaaaa aa', ''])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
211 :call add(tl, [2, 'a\{-2,}', 'sdfiougjdsafg'])
4675
811a4c9b51d8 updated for version 7.3.1085
Bram Moolenaar <bram@vim.org>
parents: 4673
diff changeset
212 :call add(tl, [2, 'a\{-2,}', 'aaaaasfoij ', 'aa'])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
213 :call add(tl, [2, 'a\{-,0}', 'oidfguih iuhi hiu aaaa', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
214 :call add(tl, [2, 'a\{-,5}', 'abcd', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
215 :call add(tl, [2, 'a\{-,5}', 'aaaaaaaaaa', ''])
4569
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
216 :" anti-greedy version of 'a*'
4675
811a4c9b51d8 updated for version 7.3.1085
Bram Moolenaar <bram@vim.org>
parents: 4673
diff changeset
217 :call add(tl, [2, 'a\{-}', 'bbbcddiuhfcd', ''])
811a4c9b51d8 updated for version 7.3.1085
Bram Moolenaar <bram@vim.org>
parents: 4673
diff changeset
218 :call add(tl, [2, 'a\{-}', 'aaaaioudfh coisf jda', ''])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
219 :"
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
220 :" Test groups of characters and submatches
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
221 :call add(tl, [2, '\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
222 :call add(tl, [2, '\(ab\)\+', 'abababaaaaa', 'ababab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
223 :call add(tl, [2, '\(abaaaaa\)*cd', 'cd', 'cd', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
224 :call add(tl, [2, '\(test1\)\? \(test2\)\?', 'test1 test3', 'test1 ', 'test1', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
225 :call add(tl, [2, '\(test1\)\= \(test2\) \(test4443\)\=', ' test2 test4443 yupiiiiiiiiiii', ' test2 test4443', '', 'test2', 'test4443'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
226 :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'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
227 :call add(tl, [2, '\(\(\(yyxxzz\)\)\)', 'abcdddsfiusfyyzzxxyyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
228 :call add(tl, [2, '\v((ab)+|c+)+', 'abcccaba', 'abcccab', 'ab', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
229 :call add(tl, [2, '\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
230 :call add(tl, [2, '\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
231 :call add(tl, [2, '\v(a|b*)+', 'aaaa', 'aaaa', ''])
5221
9982ec574beb updated for version 7.4a.036
Bram Moolenaar <bram@vim.org>
parents: 5218
diff changeset
232 :call add(tl, [2, '\p*', 'aá ', 'aá '])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
233 :"
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
234 :" Test greedy-ness and lazy-ness
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
235 :call add(tl, [2, 'a\{-2,7}','aaaaaaaaaaaaa', 'aa'])
4673
05d57d7c2d55 updated for version 7.3.1084
Bram Moolenaar <bram@vim.org>
parents: 4671
diff changeset
236 :call add(tl, [2, 'a\{-2,7}x','aaaaaaaaax', 'aaaaaaax'])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
237 :call add(tl, [2, 'a\{2,7}','aaaaaaaaaaaaaaaaaaaa', 'aaaaaaa'])
4673
05d57d7c2d55 updated for version 7.3.1084
Bram Moolenaar <bram@vim.org>
parents: 4671
diff changeset
238 :call add(tl, [2, 'a\{2,7}x','aaaaaaaaax', 'aaaaaaax'])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
239 :call add(tl, [2, '\vx(.{-,8})yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz','ayxa','xayzxayz'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
240 :call add(tl, [2, '\vx(.*)yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz', 'ayxayzxayzxa',''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
241 :call add(tl, [2, '\v(a{1,2}){-2,3}','aaaaaaa','aaaa','aa'])
5895
b871734bf54e updated for version 7.4.290
Bram Moolenaar <bram@vim.org>
parents: 5893
diff changeset
242 :call add(tl, [2, '\v(a{-1,3})+', 'aa', 'aa', 'a'])
b871734bf54e updated for version 7.4.290
Bram Moolenaar <bram@vim.org>
parents: 5893
diff changeset
243 :call add(tl, [2, '^\s\{-}\zs\( x\|x$\)', ' x', ' x', ' x'])
b871734bf54e updated for version 7.4.290
Bram Moolenaar <bram@vim.org>
parents: 5893
diff changeset
244 :call add(tl, [2, '^\s\{-}\zs\(x\| x$\)', ' x', ' x', ' x'])
b871734bf54e updated for version 7.4.290
Bram Moolenaar <bram@vim.org>
parents: 5893
diff changeset
245 :call add(tl, [2, '^\s\{-}\ze\(x\| x$\)', ' x', '', ' x'])
b871734bf54e updated for version 7.4.290
Bram Moolenaar <bram@vim.org>
parents: 5893
diff changeset
246 :call add(tl, [2, '^\(\s\{-}\)\(x\| x$\)', ' x', ' x', '', ' x'])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
247 :"
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
248 :" Test Character classes
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
249 :call add(tl, [2, '\d\+e\d\d','test 10e23 fd','10e23'])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
250 :"
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
251 :" Test collections and character range []
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
252 :call add(tl, [2, '\v[a]', 'abcd', 'a'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
253 :call add(tl, [2, 'a[bcd]', 'abcd', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
254 :call add(tl, [2, 'a[b-d]', 'acbd', 'ac'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
255 :call add(tl, [2, '[a-d][e-f][x-x]d', 'cexdxx', 'cexd'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
256 :call add(tl, [2, '\v[[:alpha:]]+', 'abcdefghijklmnopqrstuvwxyz6','abcdefghijklmnopqrstuvwxyz'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
257 :call add(tl, [2, '[[:alpha:]\+]', '6x8','x'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
258 :call add(tl, [2, '[^abc]\+','abcabcabc'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
259 :call add(tl, [2, '[^abc]','defghiasijvoinasoiunbvb','d'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
260 :call add(tl, [2, '[^abc]\+','ddddddda','ddddddd'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
261 :call add(tl, [2, '[^a-d]\+','aaaAAAZIHFNCddd','AAAZIHFNC'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
262 :call add(tl, [2, '[a-f]*','iiiiiiii',''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
263 :call add(tl, [2, '[a-f]*','abcdefgh','abcdef'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
264 :call add(tl, [2, '[^a-f]\+','abcdefgh','gh'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
265 :call add(tl, [2, '[a-c]\{-3,6}','abcabc','abc'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
266 :call add(tl, [2, '[^[:alpha:]]\+','abcccadfoij7787ysf287yrnccdu','7787'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
267 :call add(tl, [2, '[-a]', '-', '-'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
268 :call add(tl, [2, '[a-]', '-', '-'])
4805
66803af09906 updated for version 7.3.1149
Bram Moolenaar <bram@vim.org>
parents: 4750
diff changeset
269 :call add(tl, [2, '[a-f]*\c','ABCDEFGH','ABCDEF'])
66803af09906 updated for version 7.3.1149
Bram Moolenaar <bram@vim.org>
parents: 4750
diff changeset
270 :call add(tl, [2, '[abc][xyz]\c','-af-AF-BY--','BY'])
4569
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
271 :" filename regexp
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
272 :call add(tl, [2, '[-./[:alnum:]_~]\+', 'log13.file', 'log13.file'])
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
273 :" special chars
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
274 :call add(tl, [2, '[\]\^\-\\]\+', '\^\\\-\---^', '\^\\\-\---^'])
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
275 :" collation elem
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
276 :call add(tl, [2, '[[.a.]]\+', 'aa', 'aa'])
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
277 :" middle of regexp
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
278 :call add(tl, [2, 'abc[0-9]*ddd', 'siuhabc ii'])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
279 :call add(tl, [2, 'abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
280 :call add(tl, [2, '\_[0-9]\+', 'asfi9888u', '9888'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
281 :call add(tl, [2, '[0-9\n]\+', 'asfi9888u', '9888'])
4555
b2946c06d1b6 updated for version 7.3.1025
Bram Moolenaar <bram@vim.org>
parents: 4553
diff changeset
282 :call add(tl, [2, '\_[0-9]\+', "asfi\n9888u", "\n9888"])
b2946c06d1b6 updated for version 7.3.1025
Bram Moolenaar <bram@vim.org>
parents: 4553
diff changeset
283 :call add(tl, [2, '\_f', " \na ", "\n"])
b2946c06d1b6 updated for version 7.3.1025
Bram Moolenaar <bram@vim.org>
parents: 4553
diff changeset
284 :call add(tl, [2, '\_f\+', " \na ", "\na"])
4677
c1622ff9ed8d updated for version 7.3.1086
Bram Moolenaar <bram@vim.org>
parents: 4675
diff changeset
285 :call add(tl, [2, '[0-9A-Za-z-_.]\+', " @0_a.A-{ ", "0_a.A-"])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
286 :"
4671
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
287 :"""" Test start/end of line, start/end of file
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
288 :call add(tl, [2, '^a.', "a_\nb ", "a_"])
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
289 :call add(tl, [2, '^a.', "b a \na_"])
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
290 :call add(tl, [2, '.a$', " a\n "])
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
291 :call add(tl, [2, '.a$', " a b\n_a", "_a"])
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
292 :call add(tl, [2, '\%^a.', "a a\na", "a "])
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
293 :call add(tl, [2, '\%^a', " a \na "])
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
294 :call add(tl, [2, '.a\%$', " a\n "])
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
295 :call add(tl, [2, '.a\%$', " a\n_a", "_a"])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
296 :"
5296
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
297 :"""" Test recognition of character classes
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
298 :call add(tl, [2, '[0-7]\+', 'x0123456789x', '01234567'])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
299 :call add(tl, [2, '[^0-7]\+', '0a;X+% 897', 'a;X+% 89'])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
300 :call add(tl, [2, '[0-9]\+', 'x0123456789x', '0123456789'])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
301 :call add(tl, [2, '[^0-9]\+', '0a;X+% 9', 'a;X+% '])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
302 :call add(tl, [2, '[0-9a-fA-F]\+', 'x0189abcdefg', '0189abcdef'])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
303 :call add(tl, [2, '[^0-9A-Fa-f]\+', '0189g;X+% ab', 'g;X+% '])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
304 :call add(tl, [2, '[a-z_A-Z0-9]\+', ';+aso_SfOij ', 'aso_SfOij'])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
305 :call add(tl, [2, '[^a-z_A-Z0-9]\+', 'aSo_;+% sfOij', ';+% '])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
306 :call add(tl, [2, '[a-z_A-Z]\+', '0abyz_ABYZ;', 'abyz_ABYZ'])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
307 :call add(tl, [2, '[^a-z_A-Z]\+', 'abAB_09;+% yzYZ', '09;+% '])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
308 :call add(tl, [2, '[a-z]\+', '0abcxyz1', 'abcxyz'])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
309 :call add(tl, [2, '[a-z]\+', 'AabxyzZ', 'abxyz'])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
310 :call add(tl, [2, '[^a-z]\+', 'a;X09+% x', ';X09+% '])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
311 :call add(tl, [2, '[^a-z]\+', 'abX0;%yz', 'X0;%'])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
312 :call add(tl, [2, '[a-zA-Z]\+', '0abABxzXZ9', 'abABxzXZ'])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
313 :call add(tl, [2, '[^a-zA-Z]\+', 'ab09_;+ XZ', '09_;+ '])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
314 :call add(tl, [2, '[A-Z]\+', 'aABXYZz', 'ABXYZ'])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
315 :call add(tl, [2, '[^A-Z]\+', 'ABx0;%YZ', 'x0;%'])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
316 :call add(tl, [2, '[a-z]\+\c', '0abxyzABXYZ;', 'abxyzABXYZ'])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
317 :call add(tl, [2, '[A-Z]\+\c', '0abABxzXZ9', 'abABxzXZ'])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
318 :call add(tl, [2, '\c[^a-z]\+', 'ab09_;+ XZ', '09_;+ '])
3e9107b86b68 updated for version 7.4.001
Bram Moolenaar <bram@vim.org>
parents: 5255
diff changeset
319 :call add(tl, [2, '\c[^A-Z]\+', 'ab09_;+ XZ', '09_;+ '])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
320 :call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa'])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
321 :"
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
322 :"""" Tests for \z features
4569
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
323 :" match ends at \ze
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
324 :call add(tl, [2, 'xx \ze test', 'xx '])
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
325 :call add(tl, [2, 'abc\zeend', 'oij abcend', 'abc'])
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
326 :call add(tl, [2, 'aa\zebb\|aaxx', ' aabb ', 'aa'])
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
327 :call add(tl, [2, 'aa\zebb\|aaxx', ' aaxx ', 'aaxx'])
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
328 :call add(tl, [2, 'aabb\|aa\zebb', ' aabb ', 'aabb'])
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
329 :call add(tl, [2, 'aa\zebb\|aaebb', ' aabb ', 'aa'])
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
330 :" match starts at \zs
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
331 :call add(tl, [2, 'abc\zsdd', 'ddabcddxyzt', 'dd'])
4569
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
332 :call add(tl, [2, 'aa \zsax', ' ax'])
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
333 :call add(tl, [2, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match'])
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
334 :call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
335 :call add(tl, [2, '\>\zs.', 'aword. ', '.'])
5336
c514693882b9 updated for version 7.4.021
Bram Moolenaar <bram@vim.org>
parents: 5334
diff changeset
336 :call add(tl, [2, '\s\+\ze\[/\|\s\zs\s\+', 'is [a t', ' '])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
337 :"
4657
93b7ed814bec updated for version 7.3.1076
Bram Moolenaar <bram@vim.org>
parents: 4651
diff changeset
338 :"""" Tests for \@= and \& features
93b7ed814bec updated for version 7.3.1076
Bram Moolenaar <bram@vim.org>
parents: 4651
diff changeset
339 :call add(tl, [2, 'abc\@=', 'abc', 'ab'])
93b7ed814bec updated for version 7.3.1076
Bram Moolenaar <bram@vim.org>
parents: 4651
diff changeset
340 :call add(tl, [2, 'abc\@=cd', 'abcd', 'abcd'])
93b7ed814bec updated for version 7.3.1076
Bram Moolenaar <bram@vim.org>
parents: 4651
diff changeset
341 :call add(tl, [2, 'abc\@=', 'ababc', 'ab'])
4569
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
342 :" will never match, no matter the input text
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
343 :call add(tl, [2, 'abcd\@=e', 'abcd'])
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
344 :" will never match
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
345 :call add(tl, [2, 'abcd\@=e', 'any text in here ... '])
4657
93b7ed814bec updated for version 7.3.1076
Bram Moolenaar <bram@vim.org>
parents: 4651
diff changeset
346 :call add(tl, [2, '\v(abc)@=..', 'xabcd', 'ab', 'abc'])
4569
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
347 :call add(tl, [2, '\(.*John\)\@=.*Bob', 'here is John, and here is B'])
4657
93b7ed814bec updated for version 7.3.1076
Bram Moolenaar <bram@vim.org>
parents: 4651
diff changeset
348 :call add(tl, [2, '\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend'])
4669
2d15582e132f updated for version 7.3.1082
Bram Moolenaar <bram@vim.org>
parents: 4661
diff changeset
349 :call add(tl, [2, '\<\S\+\())\)\@=', '$((i=i+1))', 'i=i+1', '))'])
4569
f262fb02889d updated for version 7.3.1032
Bram Moolenaar <bram@vim.org>
parents: 4557
diff changeset
350 :call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B'])
4657
93b7ed814bec updated for version 7.3.1076
Bram Moolenaar <bram@vim.org>
parents: 4651
diff changeset
351 :call add(tl, [2, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob'])
93b7ed814bec updated for version 7.3.1076
Bram Moolenaar <bram@vim.org>
parents: 4651
diff changeset
352 :call add(tl, [2, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1'])
4661
0dce3d812e7a updated for version 7.3.1078
Bram Moolenaar <bram@vim.org>
parents: 4657
diff changeset
353 :call add(tl, [2, 'foo\(bar\)\@!', 'foobar'])
0dce3d812e7a updated for version 7.3.1078
Bram Moolenaar <bram@vim.org>
parents: 4657
diff changeset
354 :call add(tl, [2, 'foo\(bar\)\@!', 'foo bar', 'foo'])
0dce3d812e7a updated for version 7.3.1078
Bram Moolenaar <bram@vim.org>
parents: 4657
diff changeset
355 :call add(tl, [2, 'if \(\(then\)\@!.\)*$', ' if then else'])
0dce3d812e7a updated for version 7.3.1078
Bram Moolenaar <bram@vim.org>
parents: 4657
diff changeset
356 :call add(tl, [2, 'if \(\(then\)\@!.\)*$', ' if else ', 'if else ', ' '])
0dce3d812e7a updated for version 7.3.1078
Bram Moolenaar <bram@vim.org>
parents: 4657
diff changeset
357 :call add(tl, [2, '\(foo\)\@!bar', 'foobar', 'bar'])
0dce3d812e7a updated for version 7.3.1078
Bram Moolenaar <bram@vim.org>
parents: 4657
diff changeset
358 :call add(tl, [2, '\(foo\)\@!...bar', 'foobar'])
0dce3d812e7a updated for version 7.3.1078
Bram Moolenaar <bram@vim.org>
parents: 4657
diff changeset
359 :call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' bar foo '])
0dce3d812e7a updated for version 7.3.1078
Bram Moolenaar <bram@vim.org>
parents: 4657
diff changeset
360 :call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' foo bar '])
0dce3d812e7a updated for version 7.3.1078
Bram Moolenaar <bram@vim.org>
parents: 4657
diff changeset
361 :call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' foo xxx ', 'foo'])
5006
f451d60ab8ec updated for version 7.3.1247
Bram Moolenaar <bram@vim.org>
parents: 4997
diff changeset
362 :call add(tl, [2, '[ ]\@!\p\%([ ]\@!\p\)*:', 'implicit mappings:', 'mappings:'])
5251
2e63b6c763f7 updated for version 7.4b.002
Bram Moolenaar <bram@vim.org>
parents: 5227
diff changeset
363 :call add(tl, [2, '[ ]\@!\p\([ ]\@!\p\)*:', 'implicit mappings:', 'mappings:', 's'])
5218
4ceacc1b0054 updated for version 7.4a.035
Bram Moolenaar <bram@vim.org>
parents: 5031
diff changeset
364 :call add(tl, [2, 'm\k\+_\@=\%(_\@!\k\)\@<=\k\+e', 'mx__xe', 'mx__xe'])
5227
a08fa2919f2b updated for version 7.4a.039
Bram Moolenaar <bram@vim.org>
parents: 5221
diff changeset
365 :call add(tl, [2, '\%(\U\@<=S\k*\|S\l\)R', 'SuR', 'SuR'])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
366 :"
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
367 :"""" Combining different tests and features
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
368 :call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
369 :call add(tl, [2, '', 'abcd', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
370 :call add(tl, [2, '\v(())', 'any possible text', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
371 :call add(tl, [2, '\v%(ab(xyz)c)', ' abxyzc ', 'abxyzc', 'xyz'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
372 :call add(tl, [2, '\v(test|)empty', 'tesempty', 'empty', ''])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
373 :call add(tl, [2, '\v(a|aa)(a|aa)', 'aaa', 'aa', 'a', 'a'])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
374 :"
4478
032c9f916f25 updated for version 7.3.987
Bram Moolenaar <bram@vim.org>
parents: 4466
diff changeset
375 :"""" \%u and friends
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
376 :call add(tl, [2, '\%d32', 'yes no', ' '])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
377 :call add(tl, [2, '\%o40', 'yes no', ' '])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
378 :call add(tl, [2, '\%x20', 'yes no', ' '])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
379 :call add(tl, [2, '\%u0020', 'yes no', ' '])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
380 :call add(tl, [2, '\%U00000020', 'yes no', ' '])
5360
71e92a1cb37d updated for version 7.4.032
Bram Moolenaar <bram@vim.org>
parents: 5336
diff changeset
381 :call add(tl, [2, '\%d0', "yes\x0ano", "\x0a"])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
382 :"
4740
97560c16ca99 updated for version 7.3.1117
Bram Moolenaar <bram@vim.org>
parents: 4732
diff changeset
383 :""""" \%[abc]
97560c16ca99 updated for version 7.3.1117
Bram Moolenaar <bram@vim.org>
parents: 4732
diff changeset
384 :call add(tl, [2, 'foo\%[bar]', 'fobar'])
97560c16ca99 updated for version 7.3.1117
Bram Moolenaar <bram@vim.org>
parents: 4732
diff changeset
385 :call add(tl, [2, 'foo\%[bar]', 'foobar', 'foobar'])
97560c16ca99 updated for version 7.3.1117
Bram Moolenaar <bram@vim.org>
parents: 4732
diff changeset
386 :call add(tl, [2, 'foo\%[bar]', 'fooxx', 'foo'])
97560c16ca99 updated for version 7.3.1117
Bram Moolenaar <bram@vim.org>
parents: 4732
diff changeset
387 :call add(tl, [2, 'foo\%[bar]', 'foobxx', 'foob'])
97560c16ca99 updated for version 7.3.1117
Bram Moolenaar <bram@vim.org>
parents: 4732
diff changeset
388 :call add(tl, [2, 'foo\%[bar]', 'foobaxx', 'fooba'])
97560c16ca99 updated for version 7.3.1117
Bram Moolenaar <bram@vim.org>
parents: 4732
diff changeset
389 :call add(tl, [2, 'foo\%[bar]', 'foobarxx', 'foobar'])
97560c16ca99 updated for version 7.3.1117
Bram Moolenaar <bram@vim.org>
parents: 4732
diff changeset
390 :call add(tl, [2, 'foo\%[bar]x', 'foobxx', 'foobx'])
97560c16ca99 updated for version 7.3.1117
Bram Moolenaar <bram@vim.org>
parents: 4732
diff changeset
391 :call add(tl, [2, 'foo\%[bar]x', 'foobarxx', 'foobarx'])
97560c16ca99 updated for version 7.3.1117
Bram Moolenaar <bram@vim.org>
parents: 4732
diff changeset
392 :call add(tl, [2, '\%[bar]x', 'barxx', 'barx'])
97560c16ca99 updated for version 7.3.1117
Bram Moolenaar <bram@vim.org>
parents: 4732
diff changeset
393 :call add(tl, [2, '\%[bar]x', 'bxx', 'bx'])
97560c16ca99 updated for version 7.3.1117
Bram Moolenaar <bram@vim.org>
parents: 4732
diff changeset
394 :call add(tl, [2, '\%[bar]x', 'xxx', 'x'])
4944
613651492c19 updated for version 7.3.1217
Bram Moolenaar <bram@vim.org>
parents: 4924
diff changeset
395 :call add(tl, [2, 'b\%[[ao]r]', 'bar bor', 'bar'])
4948
eb5c3508cd7d updated for version 7.3.1219
Bram Moolenaar <bram@vim.org>
parents: 4944
diff changeset
396 :call add(tl, [2, 'b\%[[]]r]', 'b]r bor', 'b]r'])
5255
3c6e2b89875f updated for version 7.4b.004
Bram Moolenaar <bram@vim.org>
parents: 5251
diff changeset
397 :call add(tl, [2, '@\%[\w\-]*', '<http://john.net/pandoc/>[@pandoc]', '@pandoc'])
4740
97560c16ca99 updated for version 7.3.1117
Bram Moolenaar <bram@vim.org>
parents: 4732
diff changeset
398 :"
4539
532c2e850256 updated for version 7.3.1017
Bram Moolenaar <bram@vim.org>
parents: 4478
diff changeset
399 :"""" Alternatives, must use first longest match
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
400 :call add(tl, [2, 'goo\|go', 'google', 'goo'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
401 :call add(tl, [2, '\<goo\|\<go', 'google', 'goo'])
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
402 :call add(tl, [2, '\<goo\|go', 'google', 'goo'])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
403 :"
4571
b2a8e3a66f8c updated for version 7.3.1033
Bram Moolenaar <bram@vim.org>
parents: 4569
diff changeset
404 :"""" Back references
b2a8e3a66f8c updated for version 7.3.1033
Bram Moolenaar <bram@vim.org>
parents: 4569
diff changeset
405 :call add(tl, [2, '\(\i\+\) \1', ' abc abc', 'abc abc', 'abc'])
4647
857f6c53f117 updated for version 7.3.1071
Bram Moolenaar <bram@vim.org>
parents: 4615
diff changeset
406 :call add(tl, [2, '\(\i\+\) \1', 'xgoo goox', 'goo goo', 'goo'])
4571
b2a8e3a66f8c updated for version 7.3.1033
Bram Moolenaar <bram@vim.org>
parents: 4569
diff changeset
407 :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'])
4692
08fbb1ce1bc5 updated for version 7.3.1093
Bram Moolenaar <bram@vim.org>
parents: 4682
diff changeset
408 :call add(tl, [2, '\(\d*\)a \1b', ' a b ', 'a b', ''])
4901
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
409 :call add(tl, [2, '^.\(.\).\_..\1.', "aaa\naaa\nb", "aaa\naaa", 'a'])
4997
8a7d3a73adab updated for version 7.3.1243
Bram Moolenaar <bram@vim.org>
parents: 4948
diff changeset
410 :call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<!$', 'foo.bat/foo.com', 'foo.bat/foo.com', 'bat'])
8a7d3a73adab updated for version 7.3.1243
Bram Moolenaar <bram@vim.org>
parents: 4948
diff changeset
411 :call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<!$', 'foo.bat/foo.bat'])
8a7d3a73adab updated for version 7.3.1243
Bram Moolenaar <bram@vim.org>
parents: 4948
diff changeset
412 :call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<=$', 'foo.bat/foo.bat', 'foo.bat/foo.bat', 'bat', 'bat'])
5031
7ab94cb688be updated for version 7.3.1259
Bram Moolenaar <bram@vim.org>
parents: 5006
diff changeset
413 :call add(tl, [2, '\\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}', '2013-06-27${0}', '${0}', '0'])
5502
5ad60cd88339 updated for version 7.4.100
Bram Moolenaar <bram@vim.org>
parents: 5372
diff changeset
414 :call add(tl, [2, '^\(a*\)\1$', 'aaaaaaaa', 'aaaaaaaa', 'aaaa'])
5893
99374096a76b updated for version 7.4.289
Bram Moolenaar <bram@vim.org>
parents: 5504
diff changeset
415 :call add(tl, [2, '^\(a\{-2,}\)\1\+$', 'aaaaaaaaa', 'aaaaaaaaa', 'aaa'])
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
416 :"
4579
7a2be4a39423 updated for version 7.3.1037
Bram Moolenaar <bram@vim.org>
parents: 4571
diff changeset
417 :"""" Look-behind with limit
4682
2f51ee8825db updated for version 7.3.1088
Bram Moolenaar <bram@vim.org>
parents: 4679
diff changeset
418 :call add(tl, [2, '<\@<=span.', 'xxspanxx<spanyyy', 'spany'])
2f51ee8825db updated for version 7.3.1088
Bram Moolenaar <bram@vim.org>
parents: 4679
diff changeset
419 :call add(tl, [2, '<\@1<=span.', 'xxspanxx<spanyyy', 'spany'])
2f51ee8825db updated for version 7.3.1088
Bram Moolenaar <bram@vim.org>
parents: 4679
diff changeset
420 :call add(tl, [2, '<\@2<=span.', 'xxspanxx<spanyyy', 'spany'])
2f51ee8825db updated for version 7.3.1088
Bram Moolenaar <bram@vim.org>
parents: 4679
diff changeset
421 :call add(tl, [2, '\(<<\)\@<=span.', 'xxspanxxxx<spanxx<<spanyyy', 'spany', '<<'])
2f51ee8825db updated for version 7.3.1088
Bram Moolenaar <bram@vim.org>
parents: 4679
diff changeset
422 :call add(tl, [2, '\(<<\)\@1<=span.', 'xxspanxxxx<spanxx<<spanyyy'])
2f51ee8825db updated for version 7.3.1088
Bram Moolenaar <bram@vim.org>
parents: 4679
diff changeset
423 :call add(tl, [2, '\(<<\)\@2<=span.', 'xxspanxxxx<spanxx<<spanyyy', 'spany', '<<'])
2f51ee8825db updated for version 7.3.1088
Bram Moolenaar <bram@vim.org>
parents: 4679
diff changeset
424 :call add(tl, [2, '\(foo\)\@<!bar.', 'xx foobar1 xbar2 xx', 'bar2'])
4579
7a2be4a39423 updated for version 7.3.1037
Bram Moolenaar <bram@vim.org>
parents: 4571
diff changeset
425 :"
4805
66803af09906 updated for version 7.3.1149
Bram Moolenaar <bram@vim.org>
parents: 4750
diff changeset
426 :" look-behind match in front of a zero-width item
66803af09906 updated for version 7.3.1149
Bram Moolenaar <bram@vim.org>
parents: 4750
diff changeset
427 :call add(tl, [2, '\v\C%(<Last Changed:\s+)@<=.*$', '" test header'])
66803af09906 updated for version 7.3.1149
Bram Moolenaar <bram@vim.org>
parents: 4750
diff changeset
428 :call add(tl, [2, '\v\C%(<Last Changed:\s+)@<=.*$', '" Last Changed: 1970', '1970'])
66803af09906 updated for version 7.3.1149
Bram Moolenaar <bram@vim.org>
parents: 4750
diff changeset
429 :call add(tl, [2, '\(foo\)\@<=\>', 'foobar'])
66803af09906 updated for version 7.3.1149
Bram Moolenaar <bram@vim.org>
parents: 4750
diff changeset
430 :call add(tl, [2, '\(foo\)\@<=\>', 'barfoo', '', 'foo'])
4821
2f1ee97f5f23 updated for version 7.3.1157
Bram Moolenaar <bram@vim.org>
parents: 4805
diff changeset
431 :call add(tl, [2, '\(foo\)\@<=.*', 'foobar', 'bar', 'foo'])
4805
66803af09906 updated for version 7.3.1149
Bram Moolenaar <bram@vim.org>
parents: 4750
diff changeset
432 :"
5298
e29f11399cce updated for version 7.4.002
Bram Moolenaar <bram@vim.org>
parents: 5296
diff changeset
433 :" complicated look-behind match
e29f11399cce updated for version 7.4.002
Bram Moolenaar <bram@vim.org>
parents: 5296
diff changeset
434 :call add(tl, [2, '\(r\@<=\|\w\@<!\)\/', 'x = /word/;', '/'])
5372
c3d379c2a115 updated for version 7.4.037
Bram Moolenaar <bram@vim.org>
parents: 5370
diff changeset
435 :call add(tl, [2, '^[a-z]\+\ze \&\(asdf\)\@<!', 'foo bar', 'foo'])
5298
e29f11399cce updated for version 7.4.002
Bram Moolenaar <bram@vim.org>
parents: 5296
diff changeset
436 :"
4750
7793e737ec87 updated for version 7.3.1122
Bram Moolenaar <bram@vim.org>
parents: 4740
diff changeset
437 :""""" \@>
7793e737ec87 updated for version 7.3.1122
Bram Moolenaar <bram@vim.org>
parents: 4740
diff changeset
438 :call add(tl, [2, '\(a*\)\@>a', 'aaaa'])
7793e737ec87 updated for version 7.3.1122
Bram Moolenaar <bram@vim.org>
parents: 4740
diff changeset
439 :call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa'])
5334
c1ae5baa41f4 updated for version 7.4.020
Bram Moolenaar <bram@vim.org>
parents: 5298
diff changeset
440 :call add(tl, [2, '^\(.\{-}b\)\@>.', ' abcbd', ' abc', ' ab'])
5370
90e2f0729a0d updated for version 7.4.036
Bram Moolenaar <bram@vim.org>
parents: 5360
diff changeset
441 :call add(tl, [2, '\(.\{-}\)\(\)\@>$', 'abc', 'abc', 'abc', ''])
4750
7793e737ec87 updated for version 7.3.1122
Bram Moolenaar <bram@vim.org>
parents: 4740
diff changeset
442 :" TODO: BT engine does not restore submatch after failure
7793e737ec87 updated for version 7.3.1122
Bram Moolenaar <bram@vim.org>
parents: 4740
diff changeset
443 :call add(tl, [1, '\(a*\)\@>a\|a\+', 'aaaa', 'aaaa'])
7793e737ec87 updated for version 7.3.1122
Bram Moolenaar <bram@vim.org>
parents: 4740
diff changeset
444 :"
4615
5679b8ddd8cc updated for version 7.3.1055
Bram Moolenaar <bram@vim.org>
parents: 4583
diff changeset
445 :"""" "\_" prepended negated collection matches EOL
5679b8ddd8cc updated for version 7.3.1055
Bram Moolenaar <bram@vim.org>
parents: 4583
diff changeset
446 :call add(tl, [2, '\_[^8-9]\+', "asfi\n9888", "asfi\n"])
5679b8ddd8cc updated for version 7.3.1055
Bram Moolenaar <bram@vim.org>
parents: 4583
diff changeset
447 :call add(tl, [2, '\_[^a]\+', "asfi\n9888", "sfi\n9888"])
5679b8ddd8cc updated for version 7.3.1055
Bram Moolenaar <bram@vim.org>
parents: 4583
diff changeset
448 :"
4651
f10f63aaec5c updated for version 7.3.1073
Bram Moolenaar <bram@vim.org>
parents: 4647
diff changeset
449 :"""" Requiring lots of states.
4673
05d57d7c2d55 updated for version 7.3.1084
Bram Moolenaar <bram@vim.org>
parents: 4671
diff changeset
450 :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-"])
4651
f10f63aaec5c updated for version 7.3.1073
Bram Moolenaar <bram@vim.org>
parents: 4647
diff changeset
451 :"
4924
6ae32a64e153 updated for version 7.3.1207
Bram Moolenaar <bram@vim.org>
parents: 4901
diff changeset
452 :"""" Skip adding state twice
6ae32a64e153 updated for version 7.3.1207
Bram Moolenaar <bram@vim.org>
parents: 4901
diff changeset
453 :call add(tl, [2, '^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=', "#if FOO", "#if", ' FOO'])
4615
5679b8ddd8cc updated for version 7.3.1055
Bram Moolenaar <bram@vim.org>
parents: 4583
diff changeset
454 :"
6510
dfd593d81818 updated for version 7.4.582
Bram Moolenaar <bram@vim.org>
parents: 6170
diff changeset
455 :""" Test \%V atom
dfd593d81818 updated for version 7.4.582
Bram Moolenaar <bram@vim.org>
parents: 6170
diff changeset
456 :call add(tl, [2, '\%>70vGesamt', 'Jean-Michel Charlier & Victor Hubinon\Gesamtausgabe [Salleck] Buck Danny {Jean-Michel Charlier & Victor Hubinon}\Gesamtausgabe', 'Gesamt'])
dfd593d81818 updated for version 7.4.582
Bram Moolenaar <bram@vim.org>
parents: 6170
diff changeset
457 :"
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
458 :"""" Run the tests
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
459 :"
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
460 :for t in tl
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
461 : let re = t[0]
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
462 : let pat = t[1]
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
463 : let text = t[2]
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
464 : let matchidx = 3
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
465 : for engine in [0, 1, 2]
6170
3ee39fe2df7d updated for version 7.4.421
Bram Moolenaar <bram@vim.org>
parents: 5895
diff changeset
466 : if engine == 2 && re == 0 || engine == 1 && re == 1
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
467 : continue
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
468 : endif
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
469 : let &regexpengine = engine
4651
f10f63aaec5c updated for version 7.3.1073
Bram Moolenaar <bram@vim.org>
parents: 4647
diff changeset
470 : try
f10f63aaec5c updated for version 7.3.1073
Bram Moolenaar <bram@vim.org>
parents: 4647
diff changeset
471 : let l = matchlist(text, pat)
f10f63aaec5c updated for version 7.3.1073
Bram Moolenaar <bram@vim.org>
parents: 4647
diff changeset
472 : catch
5895
b871734bf54e updated for version 7.4.290
Bram Moolenaar <bram@vim.org>
parents: 5893
diff changeset
473 : $put ='ERROR ' . engine . ': pat: \"' . pat . '\", text: \"' . text . '\", caused an exception: \"' . v:exception . '\"'
4651
f10f63aaec5c updated for version 7.3.1073
Bram Moolenaar <bram@vim.org>
parents: 4647
diff changeset
474 : endtry
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
475 :" check the match itself
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
476 : if len(l) == 0 && len(t) > matchidx
5895
b871734bf54e updated for version 7.4.290
Bram Moolenaar <bram@vim.org>
parents: 5893
diff changeset
477 : $put ='ERROR ' . engine . ': pat: \"' . pat . '\", text: \"' . text . '\", did not match, expected: \"' . t[matchidx] . '\"'
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
478 : elseif len(l) > 0 && len(t) == matchidx
5895
b871734bf54e updated for version 7.4.290
Bram Moolenaar <bram@vim.org>
parents: 5893
diff changeset
479 : $put ='ERROR ' . engine . ': pat: \"' . pat . '\", text: \"' . text . '\", match: \"' . l[0] . '\", expected no match'
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
480 : elseif len(t) > matchidx && l[0] != t[matchidx]
5895
b871734bf54e updated for version 7.4.290
Bram Moolenaar <bram@vim.org>
parents: 5893
diff changeset
481 : $put ='ERROR ' . engine . ': pat: \"' . pat . '\", text: \"' . text . '\", match: \"' . l[0] . '\", expected: \"' . t[matchidx] . '\"'
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
482 : else
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
483 : $put ='OK ' . engine . ' - ' . pat
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
484 : endif
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
485 : if len(l) > 0
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
486 :" check all the nine submatches
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
487 : for i in range(1, 9)
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
488 : if len(t) <= matchidx + i
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
489 : let e = ''
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
490 : else
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
491 : let e = t[matchidx + i]
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
492 : endif
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
493 : if l[i] != e
5895
b871734bf54e updated for version 7.4.290
Bram Moolenaar <bram@vim.org>
parents: 5893
diff changeset
494 : $put ='ERROR ' . engine . ': pat: \"' . pat . '\", text: \"' . text . '\", submatch ' . i . ': \"' . l[i] . '\", expected: \"' . e . '\"'
4545
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
495 : endif
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
496 : endfor
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
497 : unlet i
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
498 : endif
f7944ce459ac updated for version 7.3.1020
Bram Moolenaar <bram@vim.org>
parents: 4539
diff changeset
499 : endfor
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
500 :endfor
1405
b63792dadc23 updated for version 7.1-120
vimboss
parents: 1357
diff changeset
501 :unlet t tl e l
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
502 :"
5031
7ab94cb688be updated for version 7.3.1259
Bram Moolenaar <bram@vim.org>
parents: 5006
diff changeset
503 :"""""" multi-line tests """"""""""""""""""""
4901
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
504 :let tl = []
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
505 :"
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
506 :"""" back references
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
507 :call add(tl, [2, '^.\(.\).\_..\1.', ['aaa', 'aaa', 'b'], ['XX', 'b']])
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
508 :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']])
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
509 :"
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
510 :"""" line breaks
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
511 :call add(tl, [2, '\S.*\nx', ['abc', 'def', 'ghi', 'xjk', 'lmn'], ['abc', 'def', 'XXjk', 'lmn']])
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
512 :"
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
513 :" Check that \_[0-9] matching EOL does not break a following \>
4901
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
514 :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', '']])
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
515 :"
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
516 :" Check a pattern with a line break and ^ and $
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
517 :call add(tl, [2, 'a\n^b$\n^c', ['a', 'b', 'c'], ['XX']])
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
518 :"
5504
ec5d11403c19 updated for version 7.4.101
Bram Moolenaar <bram@vim.org>
parents: 5502
diff changeset
519 :call add(tl, [2, '\(^.\+\n\)\1', [' dog', ' dog', 'asdf'], ['XXasdf']])
ec5d11403c19 updated for version 7.4.101
Bram Moolenaar <bram@vim.org>
parents: 5502
diff changeset
520 :"
4901
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
521 :"""" Run the multi-line tests
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
522 :"
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
523 :$put ='multi-line tests'
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
524 :for t in tl
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
525 : let re = t[0]
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
526 : let pat = t[1]
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
527 : let before = t[2]
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
528 : let after = t[3]
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
529 : for engine in [0, 1, 2]
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
530 : if engine == 2 && re == 0 || engine == 1 && re ==1
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
531 : continue
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
532 : endif
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
533 : let &regexpengine = engine
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
534 : new
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
535 : call setline(1, before)
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
536 : exe '%s/' . pat . '/XX/'
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
537 : let result = getline(1, '$')
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
538 : q!
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
539 : if result != after
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
540 : $put ='ERROR: pat: \"' . pat . '\", text: \"' . string(before) . '\", expected: \"' . string(after) . '\", got: \"' . string(result) . '\"'
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
541 : else
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
542 : $put ='OK ' . engine . ' - ' . pat
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
543 : endif
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
544 : endfor
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
545 :endfor
56fbf60e9476 updated for version 7.3.1196
Bram Moolenaar <bram@vim.org>
parents: 4891
diff changeset
546 :unlet t tl
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
547 :"
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
548 :" Check that using a pattern on two lines doesn't get messed up by using
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
549 :" matchstr() with \ze in between.
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
550 :set re=0
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
551 /^Substitute here
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
552 :.+1,.+2s/""/\='"'.matchstr(getline("."), '\d\+\ze<').'"'
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
553 /^Substitute here
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
554 :.+1,.+2yank
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
555 Gop:"
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
556 :"
4579
7a2be4a39423 updated for version 7.3.1037
Bram Moolenaar <bram@vim.org>
parents: 4571
diff changeset
557 :" Check a pattern with a look beind crossing a line boundary
7a2be4a39423 updated for version 7.3.1037
Bram Moolenaar <bram@vim.org>
parents: 4571
diff changeset
558 /^Behind:
7a2be4a39423 updated for version 7.3.1037
Bram Moolenaar <bram@vim.org>
parents: 4571
diff changeset
559 /\(<\_[xy]\+\)\@3<=start
7a2be4a39423 updated for version 7.3.1037
Bram Moolenaar <bram@vim.org>
parents: 4571
diff changeset
560 :.yank
7a2be4a39423 updated for version 7.3.1037
Bram Moolenaar <bram@vim.org>
parents: 4571
diff changeset
561 Gop:"
7a2be4a39423 updated for version 7.3.1037
Bram Moolenaar <bram@vim.org>
parents: 4571
diff changeset
562 :"
4730
749e2b2755d5 updated for version 7.3.1112
Bram Moolenaar <bram@vim.org>
parents: 4692
diff changeset
563 :" Check matching Visual area
749e2b2755d5 updated for version 7.3.1112
Bram Moolenaar <bram@vim.org>
parents: 4692
diff changeset
564 /^Visual:
749e2b2755d5 updated for version 7.3.1112
Bram Moolenaar <bram@vim.org>
parents: 4692
diff changeset
565 jfxvfx:s/\%Ve/E/g
749e2b2755d5 updated for version 7.3.1112
Bram Moolenaar <bram@vim.org>
parents: 4692
diff changeset
566 jV:s/\%Va/A/g
749e2b2755d5 updated for version 7.3.1112
Bram Moolenaar <bram@vim.org>
parents: 4692
diff changeset
567 jfxfxj:s/\%Vo/O/g
749e2b2755d5 updated for version 7.3.1112
Bram Moolenaar <bram@vim.org>
parents: 4692
diff changeset
568 :/^Visual/+1,/^Visual/+4yank
749e2b2755d5 updated for version 7.3.1112
Bram Moolenaar <bram@vim.org>
parents: 4692
diff changeset
569 Gop:"
749e2b2755d5 updated for version 7.3.1112
Bram Moolenaar <bram@vim.org>
parents: 4692
diff changeset
570 :"
4732
0798b096bab3 updated for version 7.3.1113
Bram Moolenaar <bram@vim.org>
parents: 4730
diff changeset
571 :" Check matching marks
0798b096bab3 updated for version 7.3.1113
Bram Moolenaar <bram@vim.org>
parents: 4730
diff changeset
572 /^Marks:
0798b096bab3 updated for version 7.3.1113
Bram Moolenaar <bram@vim.org>
parents: 4730
diff changeset
573 jfSmsfEme:.-4,.+6s/.\%>'s.*\%<'e../here/
0798b096bab3 updated for version 7.3.1113
Bram Moolenaar <bram@vim.org>
parents: 4730
diff changeset
574 jfSmsj0fEme:.-4,.+6s/.\%>'s\_.*\%<'e../again/
0798b096bab3 updated for version 7.3.1113
Bram Moolenaar <bram@vim.org>
parents: 4730
diff changeset
575 :/^Marks:/+1,/^Marks:/+3yank
0798b096bab3 updated for version 7.3.1113
Bram Moolenaar <bram@vim.org>
parents: 4730
diff changeset
576 Gop:"
0798b096bab3 updated for version 7.3.1113
Bram Moolenaar <bram@vim.org>
parents: 4730
diff changeset
577 :"
4583
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
578 :" Check patterns matching cursor position.
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
579 :func! Postest()
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
580 new
9371
3666915cac0b commit https://github.com/vim/vim/commit/6747fabc7348bf5f41ccfe851e2be3e900ec8ee0
Christian Brabandt <cb@256bit.org>
parents: 6510
diff changeset
581 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'])
4583
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
582 call setpos('.', [0, 1, 0, 0])
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
583 s/\%>3c.//g
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
584 call setpos('.', [0, 2, 4, 0])
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
585 s/\%#.*$//g
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
586 call setpos('.', [0, 3, 0, 0])
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
587 s/\%<3c./_/g
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
588 %s/\%4l\%>5c./_/g
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
589 %s/\%6l\%>25v./_/g
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
590 %s/\%>6l\%3c./!/g
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
591 %s/\%>7l\%12c./?/g
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
592 %s/\%>7l\%<9l\%>5v\%<8v./#/g
9371
3666915cac0b commit https://github.com/vim/vim/commit/6747fabc7348bf5f41ccfe851e2be3e900ec8ee0
Christian Brabandt <cb@256bit.org>
parents: 6510
diff changeset
593 $s/\%(|\u.*\)\@<=[^|\t]\+$//ge
4583
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
594 1,$yank
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
595 quit!
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
596 endfunc
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
597 Go-0-:set re=0
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
598 :call Postest()
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
599 :put
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
600 o-1-:set re=1
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
601 :call Postest()
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
602 :put
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
603 o-2-:set re=2
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
604 :call Postest()
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
605 :put
321cfbef9431 updated for version 7.3.1039
Bram Moolenaar <bram@vim.org>
parents: 4579
diff changeset
606 :"
4671
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
607 :" start and end of buffer
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
608 /\%^
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
609 yeGop:"
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
610 50%/\%^..
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
611 yeGopA END:"
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
612 50%/\%$
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
613 "ayb20gg/..\%$
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
614 "bybGo"apo"bp:"
b3c59716e700 updated for version 7.3.1083
Bram Moolenaar <bram@vim.org>
parents: 4669
diff changeset
615 :"
6170
3ee39fe2df7d updated for version 7.4.421
Bram Moolenaar <bram@vim.org>
parents: 5895
diff changeset
616 :" Check for detecting error
3ee39fe2df7d updated for version 7.4.421
Bram Moolenaar <bram@vim.org>
parents: 5895
diff changeset
617 :set regexpengine=2
3ee39fe2df7d updated for version 7.4.421
Bram Moolenaar <bram@vim.org>
parents: 5895
diff changeset
618 :for pat in [' \ze*', ' \zs*']
3ee39fe2df7d updated for version 7.4.421
Bram Moolenaar <bram@vim.org>
parents: 5895
diff changeset
619 : try
3ee39fe2df7d updated for version 7.4.421
Bram Moolenaar <bram@vim.org>
parents: 5895
diff changeset
620 : let l = matchlist('x x', pat)
3ee39fe2df7d updated for version 7.4.421
Bram Moolenaar <bram@vim.org>
parents: 5895
diff changeset
621 : $put ='E888 NOT detected for ' . pat
3ee39fe2df7d updated for version 7.4.421
Bram Moolenaar <bram@vim.org>
parents: 5895
diff changeset
622 : catch
3ee39fe2df7d updated for version 7.4.421
Bram Moolenaar <bram@vim.org>
parents: 5895
diff changeset
623 : $put ='E888 detected for ' . pat
3ee39fe2df7d updated for version 7.4.421
Bram Moolenaar <bram@vim.org>
parents: 5895
diff changeset
624 : endtry
3ee39fe2df7d updated for version 7.4.421
Bram Moolenaar <bram@vim.org>
parents: 5895
diff changeset
625 :endfor
3ee39fe2df7d updated for version 7.4.421
Bram Moolenaar <bram@vim.org>
parents: 5895
diff changeset
626 :"
5031
7ab94cb688be updated for version 7.3.1259
Bram Moolenaar <bram@vim.org>
parents: 5006
diff changeset
627 :""""" Write the results """""""""""""
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
628 :/\%#=1^Results/,$wq! test.out
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
629 ENDTEST
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
630
4553
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
631 Substitute here:
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
632 <T="">Ta 5</Title>
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
633 <T="">Ac 7</Title>
7b835b2969af updated for version 7.3.1024
Bram Moolenaar <bram@vim.org>
parents: 4545
diff changeset
634
4579
7a2be4a39423 updated for version 7.3.1037
Bram Moolenaar <bram@vim.org>
parents: 4571
diff changeset
635 Behind:
7a2be4a39423 updated for version 7.3.1037
Bram Moolenaar <bram@vim.org>
parents: 4571
diff changeset
636 asdfasd<yyy
7a2be4a39423 updated for version 7.3.1037
Bram Moolenaar <bram@vim.org>
parents: 4571
diff changeset
637 xxstart1
7a2be4a39423 updated for version 7.3.1037
Bram Moolenaar <bram@vim.org>
parents: 4571
diff changeset
638 asdfasd<yy
4682
2f51ee8825db updated for version 7.3.1088
Bram Moolenaar <bram@vim.org>
parents: 4679
diff changeset
639 xxxstart2
4579
7a2be4a39423 updated for version 7.3.1037
Bram Moolenaar <bram@vim.org>
parents: 4571
diff changeset
640 asdfasd<yy
4682
2f51ee8825db updated for version 7.3.1088
Bram Moolenaar <bram@vim.org>
parents: 4679
diff changeset
641 xxstart3
4579
7a2be4a39423 updated for version 7.3.1037
Bram Moolenaar <bram@vim.org>
parents: 4571
diff changeset
642
4730
749e2b2755d5 updated for version 7.3.1112
Bram Moolenaar <bram@vim.org>
parents: 4692
diff changeset
643 Visual:
749e2b2755d5 updated for version 7.3.1112
Bram Moolenaar <bram@vim.org>
parents: 4692
diff changeset
644 thexe the thexethe
749e2b2755d5 updated for version 7.3.1112
Bram Moolenaar <bram@vim.org>
parents: 4692
diff changeset
645 andaxand andaxand
749e2b2755d5 updated for version 7.3.1112
Bram Moolenaar <bram@vim.org>
parents: 4692
diff changeset
646 oooxofor foroxooo
749e2b2755d5 updated for version 7.3.1112
Bram Moolenaar <bram@vim.org>
parents: 4692
diff changeset
647 oooxofor foroxooo
749e2b2755d5 updated for version 7.3.1112
Bram Moolenaar <bram@vim.org>
parents: 4692
diff changeset
648
4732
0798b096bab3 updated for version 7.3.1113
Bram Moolenaar <bram@vim.org>
parents: 4730
diff changeset
649 Marks:
0798b096bab3 updated for version 7.3.1113
Bram Moolenaar <bram@vim.org>
parents: 4730
diff changeset
650 asdfSasdfsadfEasdf
0798b096bab3 updated for version 7.3.1113
Bram Moolenaar <bram@vim.org>
parents: 4730
diff changeset
651 asdfSas
0798b096bab3 updated for version 7.3.1113
Bram Moolenaar <bram@vim.org>
parents: 4730
diff changeset
652 dfsadfEasdf
0798b096bab3 updated for version 7.3.1113
Bram Moolenaar <bram@vim.org>
parents: 4730
diff changeset
653
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
654 Results of test64: