Added a test #9160

This commit is contained in:
Alexey Milovidov 2020-02-17 21:52:10 +03:00
parent 809b409426
commit 808e27bf30
2 changed files with 281 additions and 0 deletions

View File

@ -0,0 +1,264 @@
1
1
1
1
1
1
4 key="v" 10 v
\0 key="v" 10 v
0 v
1 v
2 v
3 v
4 v
5 v
6 v
7 v
8 v
9 v
10 v
11 v
12 v
13 v
14 v
15 v
16 v
17 v
18 v
19 v
20 v
21 v
22 v
23 v
24 v
25 v
26 v
27 v
28 v
29 v
30 v
31 v
32 v
33 v
34 v
35 v
36 v
37 v
38 v
39 v
40 v
41 v
42 v
43 v
44 v
45 v
46 v
47 v
48 v
49 v
50 v
51 v
52 v
53 v
54 v
55 v
56 v
57 v
58 v
59 v
60 v
61 v
62 v
63 v
64 v
65 v
66 v
67 v
68 v
69 v
70 v
71 v
72 v
73 v
74 v
75 v
76 v
77 v
78 v
79 v
80 v
81 v
82 v
83 v
84 v
85 v
86 v
87 v
88 v
89 v
90 v
91 v
92 v
93 v
94 v
95 v
96 v
97 v
98 v
99 v
100 v
101 v
102 v
103 v
104 v
105 v
106 v
107 v
108 v
109 v
110 v
111 v
112 v
113 v
114 v
115 v
116 v
117 v
118 v
119 v
120 v
121 v
122 v
123 v
124 v
125 v
126 v
127 v
128 v
129 v
130 v
131 v
132 v
133 v
134 v
135 v
136 v
137 v
138 v
139 v
140 v
141 v
142 v
143 v
144 v
145 v
146 v
147 v
148 v
149 v
150 v
151 v
152 v
153 v
154 v
155 v
156 v
157 v
158 v
159 v
160 v
161 v
162 v
163 v
164 v
165 v
166 v
167 v
168 v
169 v
170 v
171 v
172 v
173 v
174 v
175 v
176 v
177 v
178 v
179 v
180 v
181 v
182 v
183 v
184 v
185 v
186 v
187 v
188 v
189 v
190 v
191 v
192 v
193 v
194 v
195 v
196 v
197 v
198 v
199 v
200 v
201 v
202 v
203 v
204 v
205 v
206 v
207 v
208 v
209 v
210 v
211 v
212 v
213 v
214 v
215 v
216 v
217 v
218 v
219 v
220 v
221 v
222 v
223 v
224 v
225 v
226 v
227 v
228 v
229 v
230 v
231 v
232 v
233 v
234 v
235 v
236 v
237 v
238 v
239 v
240 v
241 v
242 v
243 v
244 v
245 v
246 v
247 v
248 v
249 v
250 v
251 v
252 v
253 v
254 v
255 v

View File

@ -0,0 +1,17 @@
select match('a key="v" ', 'key="(.*?)"');
select match(materialize('a key="v" '), 'key="(.*?)"');
select match('\0 key="v" ', 'key="(.*?)"');
select match(materialize('\0 key="v" '), 'key="(.*?)"');
select multiMatchAny('\0 key="v" ', ['key="(.*?)"']);
select multiMatchAny(materialize('\0 key="v" '), ['key="(.*?)"']);
select unhex('34') || ' key="v" ' as haystack, length(haystack), extract( haystack, 'key="(.*?)"') as needle;
-- works, result = v
select unhex('00') || ' key="v" ' as haystack, length(haystack), extract( haystack, 'key="(.*?)"') as needle;
-- before fix: returns nothing (zero-byte in the begining of haystack)
select number as char_code, extract( char(char_code) || ' key="v" ' as haystack, 'key="(.*?)"') as needle from numbers(256);
-- every other chars codes (except of zero byte) works ok