annotate src/testdir/test64.in @ 4474:0c940b6f2828 v7.3.985

updated for version 7.3.985 Problem: GTK vim not started as gvim doesn't set WM_CLASS property to a useful value. Solution: Call g_set_prgname() on startup. (James McCoy)
author Bram Moolenaar <bram@vim.org>
date Tue, 21 May 2013 12:52:04 +0200
parents 4ff8fa416a0d
children 032c9f916f25
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:
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
10 :" regexp pattern
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
11 :" text to test the pattern on
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
12 :" expected match (optional)
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
13 :" expected submatch 1 (optional)
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
14 :" expected submatch 2 (optional)
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
15 :" etc.
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
16 :" When there is no match use only the first two items.
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
17 :let tl = []
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
18
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
19 :""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
20 :"""" Previously written tests """"""""""""""""""""""""""""""""
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
21 :""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
22
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
23 :call add(tl, ['ab', 'aab', 'ab'])
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
24 :call add(tl, ['b', 'abcdef', 'b'])
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
25 :call add(tl, ['bc*', 'abccccdef', 'bcccc'])
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
26 :call add(tl, ['bc\{-}', 'abccccdef', 'b'])
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
27 :call add(tl, ['bc\{-}\(d\)', 'abccccdef', 'bccccd', 'd'])
1465
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
28 :call add(tl, ['bc*', 'abbdef', 'b'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
29 :call add(tl, ['c*', 'ccc', 'ccc'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
30 :call add(tl, ['bc*', 'abdef', 'b'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
31 :call add(tl, ['c*', 'abdef', ''])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
32 :call add(tl, ['bc\+', 'abccccdef', 'bcccc'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
33 :call add(tl, ['bc\+', 'abdef']) "no match
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
34 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
35 :"operator \|
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
36 :call add(tl, ['a\|ab', 'cabd', 'a']) "alternation is ordered
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
37 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
38 :call add(tl, ['c\?', 'ccb', 'c'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
39 :call add(tl, ['bc\?', 'abd', 'b'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
40 :call add(tl, ['bc\?', 'abccd', 'bc'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
41 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
42 :call add(tl, ['\va{1}', 'ab', 'a'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
43 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
44 :call add(tl, ['\va{2}', 'aa', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
45 :call add(tl, ['\va{2}', 'caad', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
46 :call add(tl, ['\va{2}', 'aba'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
47 :call add(tl, ['\va{2}', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
48 :call add(tl, ['\va{2}', 'abaa', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
49 :call add(tl, ['\va{2}', 'aaa', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
50 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
51 :call add(tl, ['\vb{1}', 'abca', 'b'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
52 :call add(tl, ['\vba{2}', 'abaa', 'baa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
53 :call add(tl, ['\vba{3}', 'aabaac'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
54 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
55 :call add(tl, ['\v(ab){1}', 'ab', 'ab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
56 :call add(tl, ['\v(ab){1}', 'dabc', 'ab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
57 :call add(tl, ['\v(ab){1}', 'acb'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
58 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
59 :call add(tl, ['\v(ab){0,2}', 'acb', "", ""])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
60 :call add(tl, ['\v(ab){0,2}', 'ab', 'ab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
61 :call add(tl, ['\v(ab){1,2}', 'ab', 'ab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
62 :call add(tl, ['\v(ab){1,2}', 'ababc', 'abab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
63 :call add(tl, ['\v(ab){2,4}', 'ababcab', 'abab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
64 :call add(tl, ['\v(ab){2,4}', 'abcababa', 'abab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
65 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
66 :call add(tl, ['\v(ab){2}', 'abab', 'abab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
67 :call add(tl, ['\v(ab){2}', 'cdababe', 'abab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
68 :call add(tl, ['\v(ab){2}', 'abac'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
69 :call add(tl, ['\v(ab){2}', 'abacabab', 'abab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
70 :call add(tl, ['\v((ab){2}){2}', 'abababab', 'abababab', 'abab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
71 :call add(tl, ['\v((ab){2}){2}', 'abacabababab', 'abababab', 'abab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
72 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
73 :call add(tl, ['\v(a{1}){1}', 'a', 'a', 'a'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
74 :call add(tl, ['\v(a{2}){1}', 'aa', 'aa', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
75 :call add(tl, ['\v(a{2}){1}', 'aaac', 'aa', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
76 :call add(tl, ['\v(a{2}){1}', 'daaac', 'aa', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
77 :call add(tl, ['\v(a{1}){2}', 'daaac', 'aa', 'a'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
78 :call add(tl, ['\v(a{1}){2}', 'aaa', 'aa', 'a'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
79 :call add(tl, ['\v(a{2})+', 'adaac', 'aa', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
80 :call add(tl, ['\v(a{2})+', 'aa', 'aa', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
81 :call add(tl, ['\v(a{2}){1}', 'aa', 'aa', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
82 :call add(tl, ['\v(a{1}){2}', 'aa', 'aa', 'a'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
83 :call add(tl, ['\v(a{1}){1}', 'a', 'a', 'a'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
84 :call add(tl, ['\v(a{2}){2}', 'aaaa', 'aaaa', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
85 :call add(tl, ['\v(a{2}){2}', 'aaabaaaa', 'aaaa', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
86 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
87 :call add(tl, ['\v(a+){2}', 'dadaac', 'aa', 'a'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
88 :call add(tl, ['\v(a{3}){2}', 'aaaaaaa', 'aaaaaa', 'aaa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
89 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
90 :call add(tl, ['\v(a{1,2}){2}', 'daaac', 'aaa', 'a'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
91 :call add(tl, ['\v(a{1,3}){2}', 'daaaac', 'aaaa', 'a'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
92 :call add(tl, ['\v(a{1,3}){2}', 'daaaaac', 'aaaaa', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
93 :call add(tl, ['\v(a{1,3}){3}', 'daac'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
94 :call add(tl, ['\v(a{1,2}){2}', 'dac'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
95 :call add(tl, ['\v(a+)+', 'daac', 'aa', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
96 :call add(tl, ['\v(a+)+', 'aaa', 'aaa', 'aaa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
97 :call add(tl, ['\v(a+){1,2}', 'aaa', 'aaa', 'aaa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
98 :call add(tl, ['\v(a+)(a+)', 'aaa', 'aaa', 'aa', 'a'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
99 :call add(tl, ['\v(a{3})+', 'daaaac', 'aaa', 'aaa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
100 :call add(tl, ['\v(a|b|c)+', 'aacb', 'aacb', 'b'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
101 :call add(tl, ['\v(a|b|c){2}', 'abcb', 'ab', 'b'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
102 :call add(tl, ['\v(abc){2}', 'abcabd', ])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
103 :call add(tl, ['\v(abc){2}', 'abdabcabc','abcabc', 'abc'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
104 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
105 :call add(tl, ['a*', 'cc', ''])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
106 :call add(tl, ['\v(a*)+', 'cc', ''])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
107 :call add(tl, ['\v((ab)+)+', 'ab', 'ab', 'ab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
108 :call add(tl, ['\v(((ab)+)+)+', 'ab', 'ab', 'ab', 'ab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
109 :call add(tl, ['\v(((ab)+)+)+', 'dababc', 'abab', 'abab', 'abab', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
110 :call add(tl, ['\v(a{0,2})+', 'cc', ''])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
111 :call add(tl, ['\v(a*)+', '', ''])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
112 :call add(tl, ['\v((a*)+)+', '', ''])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
113 :call add(tl, ['\v((ab)*)+', '', ''])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
114 :call add(tl, ['\va{1,3}', 'aab', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
115 :call add(tl, ['\va{2,3}', 'abaa', 'aa'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
116 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
117 :call add(tl, ['\v((ab)+|c*)+', 'abcccaba', 'abcccab', '', 'ab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
118 :call add(tl, ['\v(a{2})|(b{3})', 'bbabbbb', 'bbb', '', 'bbb'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
119 :call add(tl, ['\va{2}|b{2}', 'abab'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
120 :call add(tl, ['\v(a)+|(c)+', 'bbacbaacbbb', 'a', 'a'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
121 :call add(tl, ['\vab{2,3}c', 'aabbccccccccccccc', 'abbc'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
122 :call add(tl, ['\vab{2,3}c', 'aabbbccccccccccccc', 'abbbc'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
123 :call add(tl, ['\vab{2,3}cd{2,3}e', 'aabbbcddee', 'abbbcdde'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
124 :call add(tl, ['\va(bc){2}d', 'aabcbfbc' ])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
125 :call add(tl, ['\va*a{2}', 'a', ])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
126 :call add(tl, ['\va*a{2}', 'aa', 'aa' ])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
127 :call add(tl, ['\va*a{2}', 'aaa', 'aaa' ])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
128 :call add(tl, ['\va*a{2}', 'bbbabcc', ])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
129 :call add(tl, ['\va*b*|a*c*', 'a', 'a'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
130 :call add(tl, ['\va{1}b{1}|a{1}b{1}', ''])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
131 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
132 :"submatches
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
133 :call add(tl, ['\v(a)', 'ab', 'a', 'a'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
134 :call add(tl, ['\v(a)(b)', 'ab', 'ab', 'a', 'b'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
135 :call add(tl, ['\v(ab)(b)(c)', 'abbc', 'abbc', 'ab', 'b', 'c'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
136 :call add(tl, ['\v((a)(b))', 'ab', 'ab', 'ab', 'a', 'b'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
137 :call add(tl, ['\v(a)|(b)', 'ab', 'a', 'a'])
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
138 :"
0691866e6cc9 updated for version 7.1-180
vimboss
parents: 1405
diff changeset
139 :call add(tl, ['\v(a*)+', 'aaaa', 'aaaa', ''])
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
140 :call add(tl, ['x', 'abcdef'])
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
141
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
142 :""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
143 :""""" Simple tests """""""""""""""""""""""""""""""""""""""""""
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
144 :""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
145
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
146 :" Search single groups
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
147 :call add(tl, ['ab', 'aab', 'ab'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
148 :call add(tl, ['ab', 'baced'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
149 :call add(tl, ['ab', ' ab ', 'ab'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
150
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
151 :" Search multi-modifiers
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
152 :call add(tl, ['x*', 'xcd', 'x'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
153 :call add(tl, ['x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
154 :call add(tl, ['x*', 'abcdoij', '']) " empty match is good
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
155 :call add(tl, ['x\+', 'abcdoin']) " no match here
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
156 :call add(tl, ['x\+', 'abcdeoijdfxxiuhfij', 'xx'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
157 :call add(tl, ['x\+', 'xxxxx', 'xxxxx'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
158 :call add(tl, ['x\+', 'abc x siufhiush xxxxxxxxx', 'x'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
159 :call add(tl, ['x\=', 'x sdfoij', 'x'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
160 :call add(tl, ['x\=', 'abc sfoij', '']) " empty match is good
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
161 :call add(tl, ['x\=', 'xxxxxxxxx c', 'x'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
162 :call add(tl, ['x\?', 'x sdfoij', 'x'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
163 :call add(tl, ['x\?', 'abc sfoij', '']) " empty match is good
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
164 :call add(tl, ['x\?', 'xxxxxxxxxx c', 'x'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
165
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
166 :call add(tl, ['a\{0,0}', 'abcdfdoij', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
167 :call add(tl, ['a\{0,1}', 'asiubid axxxaaa', 'a']) " same thing as 'a?'
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
168 :call add(tl, ['a\{1,0}', 'asiubid axxxaaa', 'a']) " same thing as 'a\{0,1}'
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
169 :call add(tl, ['a\{3,6}', 'aa siofuh'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
170 :call add(tl, ['a\{3,6}', 'aaaaa asfoij afaa', 'aaaaa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
171 :call add(tl, ['a\{3,6}', 'aaaaaaaa', 'aaaaaa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
172 :call add(tl, ['a\{0}', 'asoiuj', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
173 :call add(tl, ['a\{2}', 'aaaa', 'aa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
174 :call add(tl, ['a\{2}', 'iuash fiusahfliusah fiushfilushfi uhsaifuh askfj nasfvius afg aaaa sfiuhuhiushf', 'aa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
175 :call add(tl, ['a\{2}', 'abcdefghijklmnopqrestuvwxyz1234567890'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
176 :call add(tl, ['a\{0,}', 'oij sdigfusnf', '']) " same thing as 'a*'
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
177 :call add(tl, ['a\{0,}', 'aaaaa aa', 'aaaaa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
178 :call add(tl, ['a\{2,}', 'sdfiougjdsafg'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
179 :call add(tl, ['a\{2,}', 'aaaaasfoij ', 'aaaaa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
180 :call add(tl, ['a\{,0}', 'oidfguih iuhi hiu aaaa', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
181 :call add(tl, ['a\{,5}', 'abcd', 'a'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
182 :call add(tl, ['a\{,5}', 'aaaaaaaaaa', 'aaaaa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
183 :call add(tl, ['a\{}', 'bbbcddiuhfcd', '']) " same thing as 'a*'
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
184 :call add(tl, ['a\{}', 'aaaaioudfh coisf jda', 'aaaa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
185
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
186 :call add(tl, ['a\{-0,0}', 'abcdfdoij', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
187 :call add(tl, ['a\{-0,1}', 'asiubid axxxaaa', '']) " anti-greedy version of 'a?'
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
188 :call add(tl, ['a\{-3,6}', 'aa siofuh'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
189 :call add(tl, ['a\{-3,6}', 'aaaaa asfoij afaa', 'aaa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
190 :call add(tl, ['a\{-3,6}', 'aaaaaaaa', 'aaa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
191 :call add(tl, ['a\{-0}', 'asoiuj', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
192 :call add(tl, ['a\{-2}', 'aaaa', 'aa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
193 :call add(tl, ['a\{-2}', 'abcdefghijklmnopqrestuvwxyz1234567890'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
194 :call add(tl, ['a\{-0,}', 'oij sdigfusnf', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
195 :call add(tl, ['a\{-0,}', 'aaaaa aa', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
196 :call add(tl, ['a\{-2,}', 'sdfiougjdsafg'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
197 :call add(tl, ['a\{-2,}', 'aaaaasfoij ', 'aa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
198 :call add(tl, ['a\{-,0}', 'oidfguih iuhi hiu aaaa', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
199 :call add(tl, ['a\{-,5}', 'abcd', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
200 :call add(tl, ['a\{-,5}', 'aaaaaaaaaa', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
201 :call add(tl, ['a\{-}', 'bbbcddiuhfcd', '']) " anti-greedy version of 'a*'
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
202 :call add(tl, ['a\{-}', 'aaaaioudfh coisf jda', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
203
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
204 :" Test groups of characters and submatches
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
205 :call add(tl, ['\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
206 :call add(tl, ['\(ab\)\+', 'abababaaaaa', 'ababab', 'ab'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
207 :call add(tl, ['\(abaaaaa\)*cd', 'cd', 'cd', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
208 :call add(tl, ['\(test1\)\? \(test2\)\?', 'test1 test3', 'test1 ', 'test1', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
209 :call add(tl, ['\(test1\)\= \(test2\) \(test4443\)\=', ' test2 test4443 yupiiiiiiiiiii', ' test2 test4443', '', 'test2', 'test4443'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
210 :call add(tl, ['\(\(sub1\) hello \(sub 2\)\)', 'asterix sub1 hello sub 2 obelix', 'sub1 hello sub 2', 'sub1 hello sub 2', 'sub1', 'sub 2'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
211 :call add(tl, ['\(\(\(yyxxzz\)\)\)', 'abcdddsfiusfyyzzxxyyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
212 :call add(tl, ['\v((ab)+|c+)+', 'abcccaba', 'abcccab', 'ab', 'ab'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
213 :call add(tl, ['\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
214 :call add(tl, ['\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
215 :call add(tl, ['\v(a|b*)+', 'aaaa', 'aaaa', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
216
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
217 :" Test greedy-ness and lazy-ness
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
218 :call add(tl, ['a\{-2,7}','aaaaaaaaaaaaa', 'aa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
219 :call add(tl, ['a\{2,7}','aaaaaaaaaaaaaaaaaaaa', 'aaaaaaa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
220 :call add(tl, ['\vx(.{-,8})yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz','ayxa','xayzxayz'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
221 :call add(tl, ['\vx(.*)yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz', 'ayxayzxayzxa',''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
222 :call add(tl, ['\v(a{1,2}){-2,3}','aaaaaaa','aaaa','aa'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
223 :call add(tl, ['\v(a{-1,3})+','aa','aa','a'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
224
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
225 :" Test Character classes
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
226 :call add(tl, ['\d\+e\d\d','test 10e23 fd','10e23'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
227
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
228 :" Test collections and character range []
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
229 :call add(tl, ['\v[a]', 'abcd', 'a'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
230 :call add(tl, ['a[bcd]', 'abcd', 'ab'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
231 :call add(tl, ['a[b-d]', 'acbd', 'ac'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
232 :call add(tl, ['[a-d][e-f][x-x]d', 'cexdxx', 'cexd'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
233 :call add(tl, ['\v[[:alpha:]]+', 'abcdefghijklmnopqrstuvwxyz6','abcdefghijklmnopqrstuvwxyz'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
234 :call add(tl, ['[[:alpha:]\+]', '6x8','x'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
235 :call add(tl, ['[^abc]\+','abcabcabc'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
236 :call add(tl, ['[^abc]','defghiasijvoinasoiunbvb','d'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
237 :call add(tl, ['[^abc]\+','ddddddda','ddddddd'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
238 :call add(tl, ['[^a-d]\+','aaaAAAZIHFNCddd','AAAZIHFNC'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
239 :call add(tl, ['[a-f]*','iiiiiiii',''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
240 :call add(tl, ['[a-f]*','abcdefgh','abcdef'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
241 :call add(tl, ['[^a-f]\+','abcdefgh','gh'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
242 :call add(tl, ['[a-c]\{-3,6}','abcabc','abc'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
243 :call add(tl, ['[^[:alpha:]]\+','abcccadfoij7787ysf287yrnccdu','7787'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
244 :call add(tl, ['[-a]', '-', '-'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
245 :call add(tl, ['[a-]', '-', '-'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
246 :call add(tl, ['[-./[:alnum:]_~]\+', 'log13.file', 'log13.file']) " filename regexp
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
247 :call add(tl, ['[\]\^\-\\]\+', '\^\\\-\---^', '\^\\\-\---^']) " special chars
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
248 :call add(tl, ['[[.a.]]\+', 'aa', 'aa']) " collation elem
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
249 :call add(tl, ['abc[0-9]*ddd', 'siuhabc ii']) " middle of regexp
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
250 :call add(tl, ['abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
251 :call add(tl, ['\_[0-9]\+', 'asfi9888u', '9888'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
252 :call add(tl, ['[0-9\n]\+', 'asfi9888u', '9888'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
253
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
254
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
255 :"""" Test recognition of some character classes
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
256 :call add(tl, ['[0-9]', '8', '8'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
257 :call add(tl, ['[^0-9]', '8'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
258 :call add(tl, ['[0-9a-fA-F]*', '0a7', '0a7'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
259 :call add(tl, ['[^0-9A-Fa-f]\+', '0a7'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
260 :call add(tl, ['[a-z_A-Z0-9]\+', 'aso_sfoij', 'aso_sfoij'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
261 :call add(tl, ['[a-z]', 'a', 'a'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
262 :call add(tl, ['[a-zA-Z]', 'a', 'a'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
263 :call add(tl, ['[A-Z]', 'a'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
264 :call add(tl, ['\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa'])
4466
4ff8fa416a0d updated for version 7.3.981
Bram Moolenaar <bram@vim.org>
parents: 4444
diff changeset
265 :call add(tl, ['\i\+', '&*§xx ', 'xx'])
4ff8fa416a0d updated for version 7.3.981
Bram Moolenaar <bram@vim.org>
parents: 4444
diff changeset
266 :call add(tl, ['\%#=1\i\+', '&*§xx ', 'xx'])
4ff8fa416a0d updated for version 7.3.981
Bram Moolenaar <bram@vim.org>
parents: 4444
diff changeset
267 :call add(tl, ['\f\+', '&*Ÿfname ', 'fname'])
4ff8fa416a0d updated for version 7.3.981
Bram Moolenaar <bram@vim.org>
parents: 4444
diff changeset
268 :call add(tl, ['\%#=1\i\+', '&*Ÿfname ', 'fname'])
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
269
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
270 :"""" Tests for \z features
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
271 :call add(tl, ['xx \ze test', 'xx ']) " must match after \ze
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
272 :call add(tl, ['abc\zeend', 'oij abcend', 'abc'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
273 :call add(tl, ['abc\zsdd', 'ddabcddxyzt', 'dd'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
274 :call add(tl, ['aa \zsax', ' ax']) " must match before \zs
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
275 :call add(tl, ['abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
276 :call add(tl, ['\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
277
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
278 :"""" Tests for \@ features
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
279 :call add(tl, ['abc\@=', 'abc', 'ab'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
280 :call add(tl, ['abc\@=cd', 'abcd', 'abcd'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
281 :call add(tl, ['abc\@=', 'ababc', 'ab'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
282 :call add(tl, ['abcd\@=e', 'abcd']) " will never match, no matter the input text
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
283 :call add(tl, ['abcd\@=e', 'any text in here ... ']) " will never match
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
284 :call add(tl, ['\v(abc)@=..', 'xabcd', 'ab', 'abc'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
285 :call add(tl, ['\(.*John\)\@=.*Bob', 'here is John, and here is B']) " no match
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
286 :call add(tl, ['\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
287 :call add(tl, ['.*John\&.*Bob', 'here is John, and here is B']) " no match
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
288 :call add(tl, ['.*John\&.*Bob', 'John is Bobs friend', 'John is Bob'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
289 :call add(tl, ['\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
290
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
291 :"""" Combining different tests and features
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
292 :call add(tl, ['[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
293 :call add(tl, ['[^[=a=]]\+', 'ddaãâbcd', 'dd'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
294 :call add(tl, ['', 'abcd', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
295 :call add(tl, ['\v(())', 'any possible text', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
296 :call add(tl, ['\v%(ab(xyz)c)', ' abxyzc ', 'abxyzc', 'xyz'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
297 :call add(tl, ['\v(test|)empty', 'tesempty', 'empty', ''])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
298 :call add(tl, ['\v(a|aa)(a|aa)', 'aaa', 'aa', 'a', 'a'])
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
299
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
300
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
301 :"""" Run the tests
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
302
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
303 :"
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
304 :for t in tl
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
305 : let l = matchlist(t[1], t[0])
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
306 :" check the match itself
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
307 : if len(l) == 0 && len(t) > 2
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
308 : $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", did not match, expected: \"' . t[2] . '\"'
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
309 : elseif len(l) > 0 && len(t) == 2
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
310 : $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", match: \"' . l[0] . '\", expected no match'
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
311 : elseif len(t) > 2 && l[0] != t[2]
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
312 : $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", match: \"' . l[0] . '\", expected: \"' . t[2] . '\"'
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
313 : else
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
314 : $put ='OK - ' . t[0]
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
315 : endif
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
316 : if len(l) > 0
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
317 :" check all the nine submatches
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
318 : for i in range(1, 9)
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
319 : if len(t) <= i + 2
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
320 : let e = ''
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
321 : else
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
322 : let e = t[i + 2]
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
323 : endif
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
324 : if l[i] != e
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
325 : $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", submatch ' . i . ': \"' . l[i] . '\", expected: \"' . e . '\"'
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
326 : endif
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
327 : endfor
1405
b63792dadc23 updated for version 7.1-120
vimboss
parents: 1357
diff changeset
328 : unlet i
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
329 : endif
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
330 :endfor
1405
b63792dadc23 updated for version 7.1-120
vimboss
parents: 1357
diff changeset
331 :unlet t tl e l
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
332
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
333 :" Check that \_[0-9] matching EOL does not break a following \>
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
334 :" This only works on a buffer line, not with expression evaluation
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
335 /^Find this
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
336 /\<\(\(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]\?\)\>
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
337 y$Gop:"
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
338
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
339 :/\%#=1^Results/,$wq! test.out
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
340 ENDTEST
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
341
4444
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
342 Find this:
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
343 localnet/192.168.0.1
ccecb03e5e8b updated for version 7.3.970
Bram Moolenaar <bram@vim.org>
parents: 1465
diff changeset
344
1357
4dd75cfd946f updated for version 7.1-071
vimboss
parents:
diff changeset
345 Results of test64: