• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# This set of tests is run only with the 8-bit library. It tests the POSIX
2# interface, which is supported only with the 8-bit library. This test should
3# not be run with JIT (which is not available for the POSIX interface).
4
5#forbid_utf
6#pattern posix
7
8# Test invalid options
9
10/abc/auto_callout
11** Ignored with POSIX interface: auto_callout
12
13/abc/
14   abc\=find_limits
15** Ignored with POSIX interface: find_limits
16 0: abc
17
18/abc/
19  abc\=partial_hard
20** Ignored with POSIX interface: partial_hard
21 0: abc
22
23# Real tests
24
25/abc/
26    abc
27 0: abc
28
29/^abc|def/
30    abcdef
31 0: abc
32    abcdef\=notbol
33 0: def
34
35/.*((abc)$|(def))/
36    defabc
37 0: defabc
38 1: abc
39 2: abc
40    defabc\=noteol
41 0: def
42 1: def
43 3: def
44
45/the quick brown fox/
46    the quick brown fox
47 0: the quick brown fox
48\= Expect no match
49    The Quick Brown Fox
50No match: POSIX code 17: match failed
51
52/the quick brown fox/i
53    the quick brown fox
54 0: the quick brown fox
55    The Quick Brown Fox
56 0: The Quick Brown Fox
57
58/(*LF)abc.def/
59\= Expect no match
60    abc\ndef
61No match: POSIX code 17: match failed
62
63/(*LF)abc$/
64    abc
65 0: abc
66    abc\n
67 0: abc
68
69/(abc)\2/
70Failed: POSIX code 15: bad back reference at offset 6
71
72/(abc\1)/
73\= Expect no match
74    abc
75No match: POSIX code 17: match failed
76
77/a*(b+)(z)(z)/
78    aaaabbbbzzzz
79 0: aaaabbbbzz
80 1: bbbb
81 2: z
82 3: z
83    aaaabbbbzzzz\=ovector=0
84Matched without capture
85    aaaabbbbzzzz\=ovector=1
86 0: aaaabbbbzz
87    aaaabbbbzzzz\=ovector=2
88 0: aaaabbbbzz
89 1: bbbb
90
91/(*ANY)ab.cd/
92    ab-cd
93 0: ab-cd
94    ab=cd
95 0: ab=cd
96\= Expect no match
97    ab\ncd
98No match: POSIX code 17: match failed
99
100/ab.cd/s
101    ab-cd
102 0: ab-cd
103    ab=cd
104 0: ab=cd
105    ab\ncd
106 0: ab\x0acd
107
108/a(b)c/posix_nosub
109    abc
110Matched with REG_NOSUB
111
112/a(?P<name>b)c/posix_nosub
113    abc
114Matched with REG_NOSUB
115
116/(a)\1/posix_nosub
117    zaay
118Matched with REG_NOSUB
119
120/a?|b?/
121    abc
122 0: a
123\= Expect no match
124    ddd\=notempty
125No match: POSIX code 17: match failed
126
127/\w+A/
128   CDAAAAB
129 0: CDAAAA
130
131/\w+A/ungreedy
132   CDAAAAB
133 0: CDA
134
135/\Biss\B/I,aftertext
136** Ignored with POSIX interface: info
137    Mississippi
138 0: iss
139 0+ issippi
140
141/abc/\
142Failed: POSIX code 9: bad escape sequence at offset 3
143
144"(?(?C)"
145Failed: POSIX code 11: unbalanced () at offset 6
146
147"(?(?C))"
148Failed: POSIX code 3: pattern error at offset 2
149
150/abcd/substitute_extended
151** Ignored with POSIX interface: substitute_extended
152
153/\[A]{1000000}**/expand,regerror_buffsize=31
154Failed: POSIX code 4: ? * + invalid at offset 100000
155** regerror() message truncated
156
157/\[A]{1000000}**/expand,regerror_buffsize=32
158Failed: POSIX code 4: ? * + invalid at offset 1000001
159
160# End of testdata/testinput18
161