1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 This file is part of systemd.
5 Copyright 2010 Lennart Poettering
6 Copyright 2013 Thomas H.P. Andersen
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 #include "alloc-util.h"
26 #include "specifier.h"
27 #include "string-util.h"
31 static void test_specifier_printf(void) {
32 static const Specifier table
[] = {
33 { 'a', specifier_string
, (char*) "AAAA" },
34 { 'b', specifier_string
, (char*) "BBBB" },
35 { 'm', specifier_machine_id
, NULL
},
36 { 'B', specifier_boot_id
, NULL
},
37 { 'H', specifier_host_name
, NULL
},
38 { 'v', specifier_kernel_release
, NULL
},
42 _cleanup_free_
char *w
= NULL
;
45 r
= specifier_printf("xxx a=%a b=%b yyy", table
, NULL
, &w
);
50 assert_se(streq(w
, "xxx a=AAAA b=BBBB yyy"));
53 r
= specifier_printf("machine=%m, boot=%B, host=%H, version=%v", table
, NULL
, &w
);
59 static void test_str_in_set(void) {
60 assert_se(STR_IN_SET("x", "x", "y", "z"));
61 assert_se(!STR_IN_SET("X", "x", "y", "z"));
62 assert_se(!STR_IN_SET("", "x", "y", "z"));
63 assert_se(STR_IN_SET("x", "w", "x"));
66 static void test_strptr_in_set(void) {
67 assert_se(STRPTR_IN_SET("x", "x", "y", "z"));
68 assert_se(!STRPTR_IN_SET("X", "x", "y", "z"));
69 assert_se(!STRPTR_IN_SET("", "x", "y", "z"));
70 assert_se(STRPTR_IN_SET("x", "w", "x"));
72 assert_se(!STRPTR_IN_SET(NULL
, "x", "y", "z"));
73 assert_se(!STRPTR_IN_SET(NULL
, ""));
74 /* strv cannot contain a null, hence the result below */
75 assert_se(!STRPTR_IN_SET(NULL
, NULL
));
78 static const char* const input_table_multiple
[] = {
85 static const char* const input_table_one
[] = {
90 static const char* const input_table_none
[] = {
94 static const char* const input_table_two_empties
[] = {
100 static const char* const input_table_one_empty
[] = {
106 static void test_strv_find(void) {
107 assert_se(strv_find((char **)input_table_multiple
, "three"));
108 assert_se(!strv_find((char **)input_table_multiple
, "four"));
111 static void test_strv_find_prefix(void) {
112 assert_se(strv_find_prefix((char **)input_table_multiple
, "o"));
113 assert_se(strv_find_prefix((char **)input_table_multiple
, "one"));
114 assert_se(strv_find_prefix((char **)input_table_multiple
, ""));
115 assert_se(!strv_find_prefix((char **)input_table_multiple
, "xxx"));
116 assert_se(!strv_find_prefix((char **)input_table_multiple
, "onee"));
119 static void test_strv_find_startswith(void) {
122 r
= strv_find_startswith((char **)input_table_multiple
, "o");
123 assert_se(r
&& streq(r
, "ne"));
125 r
= strv_find_startswith((char **)input_table_multiple
, "one");
126 assert_se(r
&& streq(r
, ""));
128 r
= strv_find_startswith((char **)input_table_multiple
, "");
129 assert_se(r
&& streq(r
, "one"));
131 assert_se(!strv_find_startswith((char **)input_table_multiple
, "xxx"));
132 assert_se(!strv_find_startswith((char **)input_table_multiple
, "onee"));
135 static void test_strv_join(void) {
136 _cleanup_free_
char *p
= NULL
, *q
= NULL
, *r
= NULL
, *s
= NULL
, *t
= NULL
, *v
= NULL
, *w
= NULL
;
138 p
= strv_join((char **)input_table_multiple
, ", ");
140 assert_se(streq(p
, "one, two, three"));
142 q
= strv_join((char **)input_table_multiple
, ";");
144 assert_se(streq(q
, "one;two;three"));
146 r
= strv_join((char **)input_table_multiple
, NULL
);
148 assert_se(streq(r
, "one two three"));
150 s
= strv_join((char **)input_table_one
, ", ");
152 assert_se(streq(s
, "one"));
154 t
= strv_join((char **)input_table_none
, ", ");
156 assert_se(streq(t
, ""));
158 v
= strv_join((char **)input_table_two_empties
, ", ");
160 assert_se(streq(v
, ", "));
162 w
= strv_join((char **)input_table_one_empty
, ", ");
164 assert_se(streq(w
, ""));
167 static void test_strv_unquote(const char *quoted
, char **list
) {
168 _cleanup_strv_free_
char **s
;
169 _cleanup_free_
char *j
;
174 r
= strv_split_extract(&s
, quoted
, WHITESPACE
, EXTRACT_QUOTES
);
175 assert_se(r
== (int) strv_length(list
));
177 j
= strv_join(s
, " | ");
182 assert_se(streq(list
[i
++], *t
));
184 assert_se(list
[i
] == NULL
);
187 static void test_invalid_unquote(const char *quoted
) {
191 r
= strv_split_extract(&s
, quoted
, WHITESPACE
, EXTRACT_QUOTES
);
192 assert_se(s
== NULL
);
193 assert_se(r
== -EINVAL
);
196 static void test_strv_split(void) {
199 _cleanup_strv_free_
char **l
= NULL
;
200 const char str
[] = "one,two,three";
202 l
= strv_split(str
, ",");
207 assert_se(streq(*s
, input_table_multiple
[i
++]));
211 static void test_strv_split_extract(void) {
212 _cleanup_strv_free_
char **l
= NULL
;
213 const char *str
= ":foo\\:bar::waldo:";
216 r
= strv_split_extract(&l
, str
, ":", EXTRACT_DONT_COALESCE_SEPARATORS
);
217 assert_se(r
== (int) strv_length(l
));
218 assert_se(streq_ptr(l
[0], ""));
219 assert_se(streq_ptr(l
[1], "foo:bar"));
220 assert_se(streq_ptr(l
[2], ""));
221 assert_se(streq_ptr(l
[3], "waldo"));
222 assert_se(streq_ptr(l
[4], ""));
223 assert_se(streq_ptr(l
[5], NULL
));
226 static void test_strv_split_newlines(void) {
229 _cleanup_strv_free_
char **l
= NULL
;
230 const char str
[] = "one\ntwo\nthree";
232 l
= strv_split_newlines(str
);
237 assert_se(streq(*s
, input_table_multiple
[i
++]));
241 static void test_strv_split_nulstr(void) {
242 _cleanup_strv_free_
char **l
= NULL
;
243 const char nulstr
[] = "str0\0str1\0str2\0str3\0";
245 l
= strv_split_nulstr (nulstr
);
248 assert_se(streq(l
[0], "str0"));
249 assert_se(streq(l
[1], "str1"));
250 assert_se(streq(l
[2], "str2"));
251 assert_se(streq(l
[3], "str3"));
254 static void test_strv_parse_nulstr(void) {
255 _cleanup_strv_free_
char **l
= NULL
;
256 const char nulstr
[] = "fuck\0fuck2\0fuck3\0\0fuck5\0\0xxx";
258 l
= strv_parse_nulstr(nulstr
, sizeof(nulstr
)-1);
260 puts("Parse nulstr:");
263 assert_se(streq(l
[0], "fuck"));
264 assert_se(streq(l
[1], "fuck2"));
265 assert_se(streq(l
[2], "fuck3"));
266 assert_se(streq(l
[3], ""));
267 assert_se(streq(l
[4], "fuck5"));
268 assert_se(streq(l
[5], ""));
269 assert_se(streq(l
[6], "xxx"));
272 static void test_strv_overlap(void) {
273 const char * const input_table
[] = {
279 const char * const input_table_overlap
[] = {
283 const char * const input_table_unique
[] = {
290 assert_se(strv_overlap((char **)input_table
, (char**)input_table_overlap
));
291 assert_se(!strv_overlap((char **)input_table
, (char**)input_table_unique
));
294 static void test_strv_sort(void) {
295 const char* input_table
[] = {
299 "CAPITAL LETTERS FIRST",
304 strv_sort((char **)input_table
);
306 assert_se(streq(input_table
[0], "CAPITAL LETTERS FIRST"));
307 assert_se(streq(input_table
[1], "apple"));
308 assert_se(streq(input_table
[2], "banana"));
309 assert_se(streq(input_table
[3], "citrus"));
310 assert_se(streq(input_table
[4], "durian"));
313 static void test_strv_extend_strv_concat(void) {
314 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
;
316 a
= strv_new("without", "suffix", NULL
);
317 b
= strv_new("with", "suffix", NULL
);
321 assert_se(strv_extend_strv_concat(&a
, b
, "_suffix") >= 0);
323 assert_se(streq(a
[0], "without"));
324 assert_se(streq(a
[1], "suffix"));
325 assert_se(streq(a
[2], "with_suffix"));
326 assert_se(streq(a
[3], "suffix_suffix"));
329 static void test_strv_extend_strv(void) {
330 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
, **n
= NULL
;
332 a
= strv_new("abc", "def", "ghi", NULL
);
333 b
= strv_new("jkl", "mno", "abc", "pqr", NULL
);
337 assert_se(strv_extend_strv(&a
, b
, true) == 3);
339 assert_se(streq(a
[0], "abc"));
340 assert_se(streq(a
[1], "def"));
341 assert_se(streq(a
[2], "ghi"));
342 assert_se(streq(a
[3], "jkl"));
343 assert_se(streq(a
[4], "mno"));
344 assert_se(streq(a
[5], "pqr"));
345 assert_se(strv_length(a
) == 6);
347 assert_se(strv_extend_strv(&n
, b
, false) >= 0);
348 assert_se(streq(n
[0], "jkl"));
349 assert_se(streq(n
[1], "mno"));
350 assert_se(streq(n
[2], "abc"));
351 assert_se(streq(n
[3], "pqr"));
352 assert_se(strv_length(n
) == 4);
355 static void test_strv_extend(void) {
356 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
;
358 a
= strv_new("test", "test1", NULL
);
360 assert_se(strv_extend(&a
, "test2") >= 0);
361 assert_se(strv_extend(&b
, "test3") >= 0);
363 assert_se(streq(a
[0], "test"));
364 assert_se(streq(a
[1], "test1"));
365 assert_se(streq(a
[2], "test2"));
366 assert_se(streq(b
[0], "test3"));
369 static void test_strv_extendf(void) {
370 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
;
372 a
= strv_new("test", "test1", NULL
);
374 assert_se(strv_extendf(&a
, "test2 %s %d %s", "foo", 128, "bar") >= 0);
375 assert_se(strv_extendf(&b
, "test3 %s %s %d", "bar", "foo", 128) >= 0);
377 assert_se(streq(a
[0], "test"));
378 assert_se(streq(a
[1], "test1"));
379 assert_se(streq(a
[2], "test2 foo 128 bar"));
380 assert_se(streq(b
[0], "test3 bar foo 128"));
383 static void test_strv_foreach(void) {
384 _cleanup_strv_free_
char **a
;
388 a
= strv_new("one", "two", "three", NULL
);
392 STRV_FOREACH(check
, a
) {
393 assert_se(streq(*check
, input_table_multiple
[i
++]));
397 static void test_strv_foreach_backwards(void) {
398 _cleanup_strv_free_
char **a
;
402 a
= strv_new("one", "two", "three", NULL
);
406 STRV_FOREACH_BACKWARDS(check
, a
)
407 assert_se(streq_ptr(*check
, input_table_multiple
[i
--]));
409 STRV_FOREACH_BACKWARDS(check
, (char**) NULL
)
410 assert_not_reached("Let's see that we check empty strv right, too.");
412 STRV_FOREACH_BACKWARDS(check
, (char**) { NULL
})
413 assert_not_reached("Let's see that we check empty strv right, too.");
416 static void test_strv_foreach_pair(void) {
417 _cleanup_strv_free_
char **a
= NULL
;
420 a
= strv_new("pair_one", "pair_one",
421 "pair_two", "pair_two",
422 "pair_three", "pair_three",
425 STRV_FOREACH_PAIR(x
, y
, a
) {
426 assert_se(streq(*x
, *y
));
430 static void test_strv_from_stdarg_alloca_one(char **l
, const char *first
, ...) {
434 j
= strv_from_stdarg_alloca(first
);
437 assert_se(streq_ptr(l
[i
], j
[i
]));
444 static void test_strv_from_stdarg_alloca(void) {
445 test_strv_from_stdarg_alloca_one(STRV_MAKE("foo", "bar"), "foo", "bar", NULL
);
446 test_strv_from_stdarg_alloca_one(STRV_MAKE("foo"), "foo", NULL
);
447 test_strv_from_stdarg_alloca_one(STRV_MAKE_EMPTY
, NULL
);
450 static void test_strv_insert(void) {
451 _cleanup_strv_free_
char **a
= NULL
;
453 assert_se(strv_insert(&a
, 0, strdup("first")) == 0);
454 assert_se(streq(a
[0], "first"));
457 assert_se(strv_insert(&a
, 0, NULL
) == 0);
458 assert_se(streq(a
[0], "first"));
461 assert_se(strv_insert(&a
, 1, strdup("two")) == 0);
462 assert_se(streq(a
[0], "first"));
463 assert_se(streq(a
[1], "two"));
466 assert_se(strv_insert(&a
, 4, strdup("tri")) == 0);
467 assert_se(streq(a
[0], "first"));
468 assert_se(streq(a
[1], "two"));
469 assert_se(streq(a
[2], "tri"));
472 assert_se(strv_insert(&a
, 1, strdup("duo")) == 0);
473 assert_se(streq(a
[0], "first"));
474 assert_se(streq(a
[1], "duo"));
475 assert_se(streq(a
[2], "two"));
476 assert_se(streq(a
[3], "tri"));
480 static void test_strv_push_prepend(void) {
481 _cleanup_strv_free_
char **a
= NULL
;
483 a
= strv_new("foo", "bar", "three", NULL
);
485 assert_se(strv_push_prepend(&a
, strdup("first")) >= 0);
486 assert_se(streq(a
[0], "first"));
487 assert_se(streq(a
[1], "foo"));
488 assert_se(streq(a
[2], "bar"));
489 assert_se(streq(a
[3], "three"));
492 assert_se(strv_consume_prepend(&a
, strdup("first2")) >= 0);
493 assert_se(streq(a
[0], "first2"));
494 assert_se(streq(a
[1], "first"));
495 assert_se(streq(a
[2], "foo"));
496 assert_se(streq(a
[3], "bar"));
497 assert_se(streq(a
[4], "three"));
501 static void test_strv_push(void) {
502 _cleanup_strv_free_
char **a
= NULL
;
505 assert_se(i
= strdup("foo"));
506 assert_se(strv_push(&a
, i
) >= 0);
508 assert_se(i
= strdup("a"));
509 assert_se(j
= strdup("b"));
510 assert_se(strv_push_pair(&a
, i
, j
) >= 0);
512 assert_se(streq_ptr(a
[0], "foo"));
513 assert_se(streq_ptr(a
[1], "a"));
514 assert_se(streq_ptr(a
[2], "b"));
515 assert_se(streq_ptr(a
[3], NULL
));
518 static void test_strv_equal(void) {
519 _cleanup_strv_free_
char **a
= NULL
;
520 _cleanup_strv_free_
char **b
= NULL
;
521 _cleanup_strv_free_
char **c
= NULL
;
523 a
= strv_new("one", "two", "three", NULL
);
525 b
= strv_new("one", "two", "three", NULL
);
527 c
= strv_new("one", "two", "three", "four", NULL
);
530 assert_se(strv_equal(a
, a
));
531 assert_se(strv_equal(a
, b
));
532 assert_se(strv_equal(NULL
, NULL
));
534 assert_se(!strv_equal(a
, c
));
535 assert_se(!strv_equal(b
, c
));
536 assert_se(!strv_equal(b
, NULL
));
539 static void test_strv_is_uniq(void) {
540 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
, **c
= NULL
, **d
= NULL
;
542 a
= strv_new(NULL
, NULL
);
544 assert_se(strv_is_uniq(a
));
546 b
= strv_new("foo", NULL
);
548 assert_se(strv_is_uniq(b
));
550 c
= strv_new("foo", "bar", NULL
);
552 assert_se(strv_is_uniq(c
));
554 d
= strv_new("foo", "bar", "waldo", "bar", "piep", NULL
);
556 assert_se(!strv_is_uniq(d
));
559 static void test_strv_reverse(void) {
560 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
, **c
= NULL
, **d
= NULL
;
562 a
= strv_new(NULL
, NULL
);
566 assert_se(strv_isempty(a
));
568 b
= strv_new("foo", NULL
);
571 assert_se(streq_ptr(b
[0], "foo"));
572 assert_se(streq_ptr(b
[1], NULL
));
574 c
= strv_new("foo", "bar", NULL
);
577 assert_se(streq_ptr(c
[0], "bar"));
578 assert_se(streq_ptr(c
[1], "foo"));
579 assert_se(streq_ptr(c
[2], NULL
));
581 d
= strv_new("foo", "bar", "waldo", NULL
);
584 assert_se(streq_ptr(d
[0], "waldo"));
585 assert_se(streq_ptr(d
[1], "bar"));
586 assert_se(streq_ptr(d
[2], "foo"));
587 assert_se(streq_ptr(d
[3], NULL
));
590 static void test_strv_shell_escape(void) {
591 _cleanup_strv_free_
char **v
= NULL
;
593 v
= strv_new("foo:bar", "bar,baz", "wal\\do", NULL
);
595 assert_se(strv_shell_escape(v
, ",:"));
596 assert_se(streq_ptr(v
[0], "foo\\:bar"));
597 assert_se(streq_ptr(v
[1], "bar\\,baz"));
598 assert_se(streq_ptr(v
[2], "wal\\\\do"));
599 assert_se(streq_ptr(v
[3], NULL
));
602 static void test_strv_skip_one(char **a
, size_t n
, char **b
) {
604 assert_se(strv_equal(a
, b
));
607 static void test_strv_skip(void) {
608 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 0, STRV_MAKE("foo", "bar", "baz"));
609 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 1, STRV_MAKE("bar", "baz"));
610 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 2, STRV_MAKE("baz"));
611 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 3, STRV_MAKE(NULL
));
612 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 4, STRV_MAKE(NULL
));
613 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 55, STRV_MAKE(NULL
));
615 test_strv_skip_one(STRV_MAKE("quux"), 0, STRV_MAKE("quux"));
616 test_strv_skip_one(STRV_MAKE("quux"), 1, STRV_MAKE(NULL
));
617 test_strv_skip_one(STRV_MAKE("quux"), 55, STRV_MAKE(NULL
));
619 test_strv_skip_one(STRV_MAKE(NULL
), 0, STRV_MAKE(NULL
));
620 test_strv_skip_one(STRV_MAKE(NULL
), 1, STRV_MAKE(NULL
));
621 test_strv_skip_one(STRV_MAKE(NULL
), 55, STRV_MAKE(NULL
));
624 static void test_strv_extend_n(void) {
625 _cleanup_strv_free_
char **v
= NULL
;
627 v
= strv_new("foo", "bar", NULL
);
630 assert_se(strv_extend_n(&v
, "waldo", 3) >= 0);
631 assert_se(strv_extend_n(&v
, "piep", 2) >= 0);
633 assert_se(streq(v
[0], "foo"));
634 assert_se(streq(v
[1], "bar"));
635 assert_se(streq(v
[2], "waldo"));
636 assert_se(streq(v
[3], "waldo"));
637 assert_se(streq(v
[4], "waldo"));
638 assert_se(streq(v
[5], "piep"));
639 assert_se(streq(v
[6], "piep"));
640 assert_se(v
[7] == NULL
);
644 assert_se(strv_extend_n(&v
, "foo", 1) >= 0);
645 assert_se(strv_extend_n(&v
, "bar", 0) >= 0);
647 assert_se(streq(v
[0], "foo"));
648 assert_se(v
[1] == NULL
);
651 static void test_strv_make_nulstr_one(char **l
) {
652 _cleanup_free_
char *b
= NULL
, *c
= NULL
;
653 _cleanup_strv_free_
char **q
= NULL
;
654 const char *s
= NULL
;
658 assert_se(strv_make_nulstr(l
, &b
, &n
) >= 0);
659 assert_se(q
= strv_parse_nulstr(b
, n
));
660 assert_se(strv_equal(l
, q
));
662 assert_se(strv_make_nulstr(q
, &c
, &m
) >= 0);
664 assert_se(memcmp(b
, c
, m
) == 0);
667 assert_se(streq(s
, l
[i
++]));
668 assert_se(i
== strv_length(l
));
671 static void test_strv_make_nulstr(void) {
672 test_strv_make_nulstr_one(NULL
);
673 test_strv_make_nulstr_one(STRV_MAKE(NULL
));
674 test_strv_make_nulstr_one(STRV_MAKE("foo"));
675 test_strv_make_nulstr_one(STRV_MAKE("foo", "bar"));
676 test_strv_make_nulstr_one(STRV_MAKE("foo", "bar", "quuux"));
679 static void test_strv_free_free(void) {
682 assert_se(t
= new(char**, 3));
683 assert_se(t
[0] = strv_new("a", "b", NULL
));
684 assert_se(t
[1] = strv_new("c", "d", "e", NULL
));
687 t
= strv_free_free(t
);
690 static void test_foreach_string(void) {
691 const char * const t
[] = {
700 FOREACH_STRING(x
, "foo", "bar", "waldo")
701 assert_se(streq_ptr(t
[i
++], x
));
705 FOREACH_STRING(x
, "zzz")
706 assert_se(streq(x
, "zzz"));
709 static void test_strv_fnmatch(void) {
710 _cleanup_strv_free_
char **v
= NULL
;
712 assert_se(!strv_fnmatch(STRV_MAKE_EMPTY
, "a", 0));
714 v
= strv_new("*\\*", NULL
);
715 assert_se(!strv_fnmatch(v
, "\\", 0));
716 assert_se(strv_fnmatch(v
, "\\", FNM_NOESCAPE
));
719 int main(int argc
, char *argv
[]) {
720 test_specifier_printf();
722 test_strptr_in_set();
724 test_strv_foreach_backwards();
725 test_strv_foreach_pair();
727 test_strv_find_prefix();
728 test_strv_find_startswith();
731 test_strv_unquote(" foo=bar \"waldo\" zzz ", STRV_MAKE("foo=bar", "waldo", "zzz"));
732 test_strv_unquote("", STRV_MAKE_EMPTY
);
733 test_strv_unquote(" ", STRV_MAKE_EMPTY
);
734 test_strv_unquote(" ", STRV_MAKE_EMPTY
);
735 test_strv_unquote(" x", STRV_MAKE("x"));
736 test_strv_unquote("x ", STRV_MAKE("x"));
737 test_strv_unquote(" x ", STRV_MAKE("x"));
738 test_strv_unquote(" \"x\" ", STRV_MAKE("x"));
739 test_strv_unquote(" 'x' ", STRV_MAKE("x"));
740 test_strv_unquote(" 'x\"' ", STRV_MAKE("x\""));
741 test_strv_unquote(" \"x'\" ", STRV_MAKE("x'"));
742 test_strv_unquote("a '--b=c \"d e\"'", STRV_MAKE("a", "--b=c \"d e\""));
744 /* trailing backslashes */
745 test_strv_unquote(" x\\\\", STRV_MAKE("x\\"));
746 test_invalid_unquote(" x\\");
748 test_invalid_unquote("a --b='c \"d e\"''");
749 test_invalid_unquote("a --b='c \"d e\" '\"");
750 test_invalid_unquote("a --b='c \"d e\"garbage");
751 test_invalid_unquote("'");
752 test_invalid_unquote("\"");
753 test_invalid_unquote("'x'y'g");
756 test_strv_split_extract();
757 test_strv_split_newlines();
758 test_strv_split_nulstr();
759 test_strv_parse_nulstr();
762 test_strv_extend_strv();
763 test_strv_extend_strv_concat();
766 test_strv_from_stdarg_alloca();
768 test_strv_push_prepend();
773 test_strv_shell_escape();
775 test_strv_extend_n();
776 test_strv_make_nulstr();
777 test_strv_free_free();
779 test_foreach_string();