Lines Matching refs:p

12         const char *p, *original;  in TEST()  local
15 p = original = "foobar waldo"; in TEST()
16 assert_se(extract_first_word(&p, &t, NULL, 0) > 0); in TEST()
19 assert_se(p == original + 7); in TEST()
21 assert_se(extract_first_word(&p, &t, NULL, 0) > 0); in TEST()
24 assert_se(isempty(p)); in TEST()
26 assert_se(extract_first_word(&p, &t, NULL, 0) == 0); in TEST()
28 assert_se(isempty(p)); in TEST()
30 p = original = "\"foobar\" \'waldo\'"; in TEST()
31 assert_se(extract_first_word(&p, &t, NULL, 0) > 0); in TEST()
34 assert_se(p == original + 9); in TEST()
36 assert_se(extract_first_word(&p, &t, NULL, 0) > 0); in TEST()
39 assert_se(isempty(p)); in TEST()
41 assert_se(extract_first_word(&p, &t, NULL, 0) == 0); in TEST()
43 assert_se(isempty(p)); in TEST()
45 p = original = "\"foobar\" \'waldo\'"; in TEST()
46 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE) > 0); in TEST()
49 assert_se(p == original + 9); in TEST()
51 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE) > 0); in TEST()
54 assert_se(isempty(p)); in TEST()
56 assert_se(extract_first_word(&p, &t, NULL, 0) == 0); in TEST()
58 assert_se(isempty(p)); in TEST()
60 p = original = "\""; in TEST()
61 assert_se(extract_first_word(&p, &t, NULL, 0) == 1); in TEST()
64 assert_se(isempty(p)); in TEST()
66 p = original = "\""; in TEST()
67 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE) == -EINVAL); in TEST()
68 assert_se(p == original + 1); in TEST()
70 p = original = "\'"; in TEST()
71 assert_se(extract_first_word(&p, &t, NULL, 0) == 1); in TEST()
74 assert_se(isempty(p)); in TEST()
76 p = original = "\'"; in TEST()
77 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE) == -EINVAL); in TEST()
78 assert_se(p == original + 1); in TEST()
80 p = original = "\'fooo"; in TEST()
81 assert_se(extract_first_word(&p, &t, NULL, 0) == 1); in TEST()
84 assert_se(isempty(p)); in TEST()
86 p = original = "KEY=val \"KEY2=val with space\" \"KEY3=val with \\\"quotation\\\"\""; in TEST()
87 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE) == 1); in TEST()
90 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE) == 1); in TEST()
93 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE) == 1); in TEST()
96 assert_se(isempty(p)); in TEST()
98 p = original = "KEY=val \"KEY2=val space\" \"KEY3=val with \\\"quotation\\\"\""; in TEST()
99 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_RETAIN_ESCAPE) == 1); in TEST()
102 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_RETAIN_ESCAPE) == 1); in TEST()
105 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_RETAIN_ESCAPE) == 1); in TEST()
108 assert_se(startswith(p, "\"KEY3=")); in TEST()
110 p = original = "\'fooo"; in TEST()
111 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE) == -EINVAL); in TEST()
112 assert_se(p == original + 5); in TEST()
114 p = original = "\'fooo"; in TEST()
115 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE|EXTRACT_RELAX) > 0); in TEST()
118 assert_se(isempty(p)); in TEST()
120 p = original = "\"fooo"; in TEST()
121 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE|EXTRACT_RELAX) > 0); in TEST()
124 assert_se(isempty(p)); in TEST()
126 p = original = "yay\'foo\'bar"; in TEST()
127 assert_se(extract_first_word(&p, &t, NULL, 0) > 0); in TEST()
130 assert_se(isempty(p)); in TEST()
132 p = original = "yay\'foo\'bar"; in TEST()
133 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE) > 0); in TEST()
136 assert_se(isempty(p)); in TEST()
138 p = original = " foobar "; in TEST()
139 assert_se(extract_first_word(&p, &t, NULL, 0) > 0); in TEST()
142 assert_se(isempty(p)); in TEST()
144 p = original = " foo\\ba\\x6ar "; in TEST()
145 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE) > 0); in TEST()
148 assert_se(isempty(p)); in TEST()
150 p = original = " foo\\ba\\x6ar "; in TEST()
151 assert_se(extract_first_word(&p, &t, NULL, 0) > 0); in TEST()
154 assert_se(isempty(p)); in TEST()
156 p = original = " f\\u00f6o \"pi\\U0001F4A9le\" "; in TEST()
157 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE) > 0); in TEST()
160 assert_se(p == original + 13); in TEST()
162 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE|EXTRACT_CUNESCAPE) > 0); in TEST()
165 assert_se(isempty(p)); in TEST()
167 p = original = "fooo\\"; in TEST()
168 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_RELAX) > 0); in TEST()
171 assert_se(isempty(p)); in TEST()
173 p = original = "fooo\\"; in TEST()
174 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNESCAPE_RELAX) > 0); in TEST()
177 assert_se(isempty(p)); in TEST()
179 p = original = "fooo\\"; in TEST()
180 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNESCAPE_RELAX|EXTRACT_RELAX) > 0); in TEST()
183 assert_se(isempty(p)); in TEST()
185 p = original = "fooo\\"; in TEST()
186 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_RELAX) > 0); in TEST()
189 assert_se(isempty(p)); in TEST()
191 p = original = "\"foo\\"; in TEST()
192 assert_se(extract_first_word(&p, &t, NULL, 0) == -EINVAL); in TEST()
193 assert_se(p == original + 5); in TEST()
195 p = original = "\"foo\\"; in TEST()
196 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE|EXTRACT_RELAX) > 0); in TEST()
199 assert_se(isempty(p)); in TEST()
201 p = original = "foo::bar"; in TEST()
202 assert_se(extract_first_word(&p, &t, ":", 0) == 1); in TEST()
205 assert_se(p == original + 5); in TEST()
207 assert_se(extract_first_word(&p, &t, ":", 0) == 1); in TEST()
210 assert_se(isempty(p)); in TEST()
212 assert_se(extract_first_word(&p, &t, ":", 0) == 0); in TEST()
214 assert_se(isempty(p)); in TEST()
216 p = original = "foo\\:bar::waldo"; in TEST()
217 assert_se(extract_first_word(&p, &t, ":", 0) == 1); in TEST()
220 assert_se(p == original + 10); in TEST()
222 assert_se(extract_first_word(&p, &t, ":", 0) == 1); in TEST()
225 assert_se(isempty(p)); in TEST()
227 assert_se(extract_first_word(&p, &t, ":", 0) == 0); in TEST()
229 assert_se(isempty(p)); in TEST()
231 p = original = "\"foo\\"; in TEST()
232 … assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE|EXTRACT_UNESCAPE_RELAX) == -EINVAL); in TEST()
233 assert_se(p == original + 5); in TEST()
235 p = original = "\"foo\\"; in TEST()
236 …assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE|EXTRACT_UNESCAPE_RELAX|EXTRACT_RELAX) >… in TEST()
239 assert_se(isempty(p)); in TEST()
241 p = original = "\"foo\\"; in TEST()
242 …assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE|EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_RELA… in TEST()
245 assert_se(isempty(p)); in TEST()
247 p = original = "fooo\\ bar quux"; in TEST()
248 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_RELAX) > 0); in TEST()
251 assert_se(p == original + 10); in TEST()
253 p = original = "fooo\\ bar quux"; in TEST()
254 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNESCAPE_RELAX) > 0); in TEST()
257 assert_se(p == original + 10); in TEST()
259 p = original = "fooo\\ bar quux"; in TEST()
260 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNESCAPE_RELAX|EXTRACT_RELAX) > 0); in TEST()
263 assert_se(p == original + 10); in TEST()
265 p = original = "fooo\\ bar quux"; in TEST()
266 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE) == -EINVAL); in TEST()
267 assert_se(p == original + 5); in TEST()
269 p = original = "fooo\\ bar quux"; in TEST()
270 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_RELAX) > 0); in TEST()
273 assert_se(p == original + 10); in TEST()
275 p = original = "\\w+@\\K[\\d.]+"; in TEST()
276 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE) == -EINVAL); in TEST()
277 assert_se(p == original + 1); in TEST()
279 p = original = "\\w+@\\K[\\d.]+"; in TEST()
280 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_RELAX) > 0); in TEST()
283 assert_se(isempty(p)); in TEST()
285 p = original = "\\w+\\b"; in TEST()
286 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_RELAX) > 0); in TEST()
289 assert_se(isempty(p)); in TEST()
291 p = original = "-N ''"; in TEST()
292 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE) > 0); in TEST()
295 assert_se(p == original + 3); in TEST()
297 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_UNQUOTE) > 0); in TEST()
300 assert_se(isempty(p)); in TEST()
302 p = original = ":foo\\:bar::waldo:"; in TEST()
303 assert_se(extract_first_word(&p, &t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1); in TEST()
307 assert_se(p == original + 1); in TEST()
309 assert_se(extract_first_word(&p, &t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1); in TEST()
312 assert_se(p == original + 10); in TEST()
314 assert_se(extract_first_word(&p, &t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1); in TEST()
318 assert_se(p == original + 11); in TEST()
320 assert_se(extract_first_word(&p, &t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1); in TEST()
323 assert_se(p == original + 17); in TEST()
325 assert_se(extract_first_word(&p, &t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1); in TEST()
328 assert_se(p == NULL); in TEST()
330 assert_se(extract_first_word(&p, &t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 0); in TEST()
332 assert_se(!p); in TEST()
334 p = "foo\\xbar"; in TEST()
335 assert_se(extract_first_word(&p, &t, NULL, 0) > 0); in TEST()
338 assert_se(p == NULL); in TEST()
340 p = "foo\\xbar"; in TEST()
341 assert_se(extract_first_word(&p, &t, NULL, EXTRACT_RETAIN_ESCAPE) > 0); in TEST()
344 assert_se(p == NULL); in TEST()
346 p = "\\:"; in TEST()
347 assert_se(extract_first_word(&p, &t, ":", EXTRACT_UNESCAPE_SEPARATORS) == 1); in TEST()
350 assert_se(p == NULL); in TEST()
352 p = "a\\:b"; in TEST()
353 assert_se(extract_first_word(&p, &t, ":", EXTRACT_UNESCAPE_SEPARATORS) == 1); in TEST()
356 assert_se(p == NULL); in TEST()
358 p = "a\\ b:c"; in TEST()
359 assert_se(extract_first_word(&p, &t, WHITESPACE ":", EXTRACT_UNESCAPE_SEPARATORS) == 1); in TEST()
362 assert_se(extract_first_word(&p, &t, WHITESPACE ":", EXTRACT_UNESCAPE_SEPARATORS) == 1); in TEST()
365 assert_se(p == NULL); in TEST()
367 p = "a\\ b:c\\x"; in TEST()
368 assert_se(extract_first_word(&p, &t, ":", EXTRACT_UNESCAPE_SEPARATORS) == -EINVAL); in TEST()
370 p = "a\\\\ b:c\\\\x"; in TEST()
371 assert_se(extract_first_word(&p, &t, ":", EXTRACT_UNESCAPE_SEPARATORS) == 1); in TEST()
374 assert_se(extract_first_word(&p, &t, ":", EXTRACT_UNESCAPE_SEPARATORS) == 1); in TEST()
377 assert_se(p == NULL); in TEST()
379 p = "\\:"; in TEST()
380 … assert_se(extract_first_word(&p, &t, ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS) == 1); in TEST()
383 assert_se(p == NULL); in TEST()
385 p = "a\\:b"; in TEST()
386 … assert_se(extract_first_word(&p, &t, ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS) == 1); in TEST()
389 assert_se(p == NULL); in TEST()
391 p = "a\\ b:c"; in TEST()
392 …assert_se(extract_first_word(&p, &t, WHITESPACE ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS… in TEST()
395 …assert_se(extract_first_word(&p, &t, WHITESPACE ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS… in TEST()
398 assert_se(p == NULL); in TEST()
400 p = "a\\ b:c\\x"; in TEST()
401 …assert_se(extract_first_word(&p, &t, ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS) == -EINVA… in TEST()
403 p = "a\\\\ b:c\\\\x"; in TEST()
404 … assert_se(extract_first_word(&p, &t, ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS) == 1); in TEST()
407 … assert_se(extract_first_word(&p, &t, ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS) == 1); in TEST()
410 assert_se(p == NULL); in TEST()
412 p = "\\:"; in TEST()
413 assert_se(extract_first_word(&p, &t, ":", EXTRACT_CUNESCAPE) == -EINVAL); in TEST()
415 p = "a\\:b"; in TEST()
416 assert_se(extract_first_word(&p, &t, ":", EXTRACT_CUNESCAPE) == -EINVAL); in TEST()
417 assert_se(extract_first_word(&p, &t, ":", EXTRACT_CUNESCAPE) == 1); in TEST()
421 p = "a\\ b:c"; in TEST()
422 assert_se(extract_first_word(&p, &t, WHITESPACE ":", EXTRACT_CUNESCAPE) == -EINVAL); in TEST()
423 assert_se(extract_first_word(&p, &t, WHITESPACE ":", EXTRACT_CUNESCAPE) == 1); in TEST()
426 assert_se(extract_first_word(&p, &t, WHITESPACE ":", EXTRACT_CUNESCAPE) == 1); in TEST()
429 assert_se(p == NULL); in TEST()
431 p = original = "foobar=\"waldo\"maldo, baldo"; in TEST()
432 assert_se(extract_first_word(&p, &t, "=\", ", 0) > 0); in TEST()
435 assert_se(extract_first_word(&p, &t, "=\", ", 0) > 0); in TEST()
438 assert_se(extract_first_word(&p, &t, "=\", ", 0) > 0); in TEST()
441 assert_se(extract_first_word(&p, &t, "=\", ", 0) > 0); in TEST()
445p = original = "mode=\"1777\",size=\"10%\",nr_inodes=\"400\"k,uid=\"496,,107\"520,gi\"\"'d=49610,'… in TEST()
446 assert_se(extract_first_word(&p, &t, ",", EXTRACT_KEEP_QUOTE) > 0); in TEST()
449 assert_se(extract_first_word(&p, &t, ",", EXTRACT_KEEP_QUOTE) > 0); in TEST()
452 assert_se(extract_first_word(&p, &t, ",", EXTRACT_KEEP_QUOTE) > 0); in TEST()
455 assert_se(extract_first_word(&p, &t, ",", EXTRACT_KEEP_QUOTE) > 0); in TEST()
458 assert_se(extract_first_word(&p, &t, ",", EXTRACT_KEEP_QUOTE) > 0); in TEST()
461 assert_se(extract_first_word(&p, &t, ",", EXTRACT_KEEP_QUOTE) > 0); in TEST()
465p = original = "mode=\"1777\",size=\"10%\",nr_inodes=\"400\"k,uid=\"496,,107\"520,gi\"\"'d=49610,'… in TEST()
466 assert_se(extract_first_word(&p, &t, ",", EXTRACT_UNQUOTE) > 0); in TEST()
469 assert_se(extract_first_word(&p, &t, ",", EXTRACT_UNQUOTE) > 0); in TEST()
472 assert_se(extract_first_word(&p, &t, ",", EXTRACT_UNQUOTE) > 0); in TEST()
475 assert_se(extract_first_word(&p, &t, ",", EXTRACT_UNQUOTE) > 0); in TEST()
478 assert_se(extract_first_word(&p, &t, ",", EXTRACT_UNQUOTE) > 0); in TEST()
481 assert_se(extract_first_word(&p, &t, ",", EXTRACT_UNQUOTE) > 0); in TEST()
485 p = "a:b"; in TEST()
486 assert_se(extract_first_word(&p, &t, ":", EXTRACT_RETAIN_SEPARATORS) == 1); in TEST()
488 assert_se(streq(p, ":b")); in TEST()
490 assert_se(extract_first_word(&p, &t, ":", EXTRACT_RETAIN_SEPARATORS) == 1); in TEST()
494 p = "a>:b"; in TEST()
495 assert_se(extract_first_word(&p, &t, ">:", EXTRACT_RETAIN_SEPARATORS) == 1); in TEST()
497 assert_se(streq(p, ">:b")); in TEST()
499 assert_se(extract_first_word(&p, &t, ">:", EXTRACT_RETAIN_SEPARATORS) == 1); in TEST()
503 p = "a>:b"; in TEST()
504 …assert_se(extract_first_word(&p, &t, ">:", EXTRACT_RETAIN_SEPARATORS|EXTRACT_DONT_COALESCE_SEPARAT… in TEST()
506 assert_se(streq(p, ">:b")); in TEST()
508 …assert_se(extract_first_word(&p, &t, ">:", EXTRACT_RETAIN_SEPARATORS|EXTRACT_DONT_COALESCE_SEPARAT… in TEST()
510 assert_se(streq(p, ">:b")); in TEST()
513 p = "a\\:b"; in TEST()
514 … assert_se(extract_first_word(&p, &t, ":", EXTRACT_RETAIN_SEPARATORS|EXTRACT_RETAIN_ESCAPE) == 1); in TEST()
516 assert_se(streq(p, ":b")); in TEST()
519 p = "a\\:b"; in TEST()
520 assert_se(extract_first_word(&p, &t, ":", EXTRACT_RETAIN_SEPARATORS) == 1); in TEST()
522 assert_se(!p); in TEST()
525 p = "a\\:b"; in TEST()
526 …assert_se(extract_first_word(&p, &t, ":", EXTRACT_RETAIN_SEPARATORS|EXTRACT_UNESCAPE_SEPARATORS) =… in TEST()
528 assert_se(!p); in TEST()
531 p = "a\\:a:b"; in TEST()
532 …assert_se(extract_first_word(&p, &t, ":", EXTRACT_RETAIN_SEPARATORS|EXTRACT_UNESCAPE_SEPARATORS) =… in TEST()
534 assert_se(streq(p, ":b")); in TEST()
539 const char *p, *original; in TEST() local
542 p = original = "foobar waldo"; in TEST()
543 assert_se(extract_first_word_and_warn(&p, &t, NULL, 0, NULL, "fake", 1, original) > 0); in TEST()
546 assert_se(p == original + 7); in TEST()
548 assert_se(extract_first_word_and_warn(&p, &t, NULL, 0, NULL, "fake", 1, original) > 0); in TEST()
551 assert_se(isempty(p)); in TEST()
553 assert_se(extract_first_word_and_warn(&p, &t, NULL, 0, NULL, "fake", 1, original) == 0); in TEST()
555 assert_se(isempty(p)); in TEST()
557 p = original = "\"foobar\" \'waldo\'"; in TEST()
558 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_UNQUOTE, NULL, "fake", 1, original) > … in TEST()
561 assert_se(p == original + 9); in TEST()
563 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_UNQUOTE, NULL, "fake", 1, original) > … in TEST()
566 assert_se(isempty(p)); in TEST()
568 assert_se(extract_first_word_and_warn(&p, &t, NULL, 0, NULL, "fake", 1, original) == 0); in TEST()
570 assert_se(isempty(p)); in TEST()
572 p = original = "\""; in TEST()
573 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_UNQUOTE, NULL, "fake", 1, original) ==… in TEST()
574 assert_se(p == original + 1); in TEST()
576 p = original = "\'"; in TEST()
577 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_UNQUOTE, NULL, "fake", 1, original) ==… in TEST()
578 assert_se(p == original + 1); in TEST()
580 p = original = "\'fooo"; in TEST()
581 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_UNQUOTE, NULL, "fake", 1, original) ==… in TEST()
582 assert_se(p == original + 5); in TEST()
584 p = original = "\'fooo"; in TEST()
585 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_UNQUOTE|EXTRACT_RELAX, NULL, "fake", 1… in TEST()
588 assert_se(isempty(p)); in TEST()
590 p = original = " foo\\ba\\x6ar "; in TEST()
591 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, "fake", 1, original) … in TEST()
594 assert_se(isempty(p)); in TEST()
596 p = original = " foo\\ba\\x6ar "; in TEST()
597 assert_se(extract_first_word_and_warn(&p, &t, NULL, 0, NULL, "fake", 1, original) > 0); in TEST()
600 assert_se(isempty(p)); in TEST()
602 p = original = " f\\u00f6o \"pi\\U0001F4A9le\" "; in TEST()
603 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, "fake", 1, original) … in TEST()
606 assert_se(p == original + 13); in TEST()
608 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_UNQUOTE|EXTRACT_CUNESCAPE, NULL, "fake… in TEST()
611 assert_se(isempty(p)); in TEST()
613 p = original = "fooo\\"; in TEST()
614 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_RELAX, NULL, "fake", 1, original) > 0); in TEST()
617 assert_se(isempty(p)); in TEST()
619 p = original = "fooo\\"; in TEST()
620 assert_se(extract_first_word_and_warn(&p, &t, NULL, 0, NULL, "fake", 1, original) > 0); in TEST()
623 assert_se(isempty(p)); in TEST()
625 p = original = "fooo\\"; in TEST()
626 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, "fake", 1, original) … in TEST()
629 assert_se(isempty(p)); in TEST()
631 p = original = "\"foo\\"; in TEST()
632 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_UNQUOTE, NULL, "fake", 1, original) ==… in TEST()
633 assert_se(p == original + 5); in TEST()
635 p = original = "\"foo\\"; in TEST()
636 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_UNQUOTE|EXTRACT_RELAX, NULL, "fake", 1… in TEST()
639 assert_se(isempty(p)); in TEST()
641 p = original = "\"foo\\"; in TEST()
642 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_UNQUOTE|EXTRACT_CUNESCAPE, NULL, "fake… in TEST()
643 assert_se(p == original + 5); in TEST()
645 p = original = "\"foo\\"; in TEST()
646 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_UNQUOTE|EXTRACT_CUNESCAPE|EXTRACT_RELA… in TEST()
649 assert_se(isempty(p)); in TEST()
651 p = original = "fooo\\ bar quux"; in TEST()
652 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_RELAX, NULL, "fake", 1, original) > 0); in TEST()
655 assert_se(p == original + 10); in TEST()
657 p = original = "fooo\\ bar quux"; in TEST()
658 assert_se(extract_first_word_and_warn(&p, &t, NULL, 0, NULL, "fake", 1, original) > 0); in TEST()
661 assert_se(p == original + 10); in TEST()
663 p = original = "fooo\\ bar quux"; in TEST()
664 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, "fake", 1, original) … in TEST()
667 assert_se(p == original + 10); in TEST()
669 p = original = "\\w+@\\K[\\d.]+"; in TEST()
670 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, "fake", 1, original) … in TEST()
673 assert_se(isempty(p)); in TEST()
675 p = original = "\\w+\\b"; in TEST()
676 …assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, "fake", 1, original) … in TEST()
679 assert_se(isempty(p)); in TEST()
683 const char *p, *original; in TEST() local
686 p = original = "foobar waldi piep"; in TEST()
687 assert_se(extract_many_words(&p, NULL, 0, &a, &b, &c, NULL) == 3); in TEST()
688 assert_se(isempty(p)); in TEST()
696 p = original = "foobar:waldi:piep ba1:ba2"; in TEST()
697 assert_se(extract_many_words(&p, ":" WHITESPACE, 0, &a, &b, &c, NULL) == 3); in TEST()
698 assert_se(!isempty(p)); in TEST()
702 assert_se(extract_many_words(&p, ":" WHITESPACE, 0, &d, &e, &f, NULL) == 2); in TEST()
703 assert_se(isempty(p)); in TEST()
714 p = original = "'foobar' wa\"ld\"i "; in TEST()
715 assert_se(extract_many_words(&p, NULL, 0, &a, &b, &c, NULL) == 2); in TEST()
716 assert_se(isempty(p)); in TEST()
723 p = original = "'foobar' wa\"ld\"i "; in TEST()
724 assert_se(extract_many_words(&p, NULL, EXTRACT_UNQUOTE, &a, &b, &c, NULL) == 2); in TEST()
725 assert_se(isempty(p)); in TEST()
732 p = original = ""; in TEST()
733 assert_se(extract_many_words(&p, NULL, 0, &a, &b, &c, NULL) == 0); in TEST()
734 assert_se(isempty(p)); in TEST()
739 p = original = " "; in TEST()
740 assert_se(extract_many_words(&p, NULL, 0, &a, &b, &c, NULL) == 0); in TEST()
741 assert_se(isempty(p)); in TEST()
746 p = original = "foobar"; in TEST()
747 assert_se(extract_many_words(&p, NULL, 0, NULL) == 0); in TEST()
748 assert_se(p == original); in TEST()
750 p = original = "foobar waldi"; in TEST()
751 assert_se(extract_many_words(&p, NULL, 0, &a, NULL) == 1); in TEST()
752 assert_se(p == original+7); in TEST()
756 p = original = " foobar "; in TEST()
757 assert_se(extract_many_words(&p, NULL, 0, &a, NULL) == 1); in TEST()
758 assert_se(isempty(p)); in TEST()