2 This file is part of systemd.
4 Copyright 2010 Lennart Poettering
5 Copyright 2013 Thomas H.P. Andersen
7 systemd is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation; either version 2.1 of the License, or
10 (at your option) any later version.
12 systemd is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public License
18 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 #include "alloc-util.h"
24 #include "specifier.h"
25 #include "string-util.h"
29 static void test_specifier_printf(void) {
30 static const Specifier table
[] = {
31 { 'a', specifier_string
, (char*) "AAAA" },
32 { 'b', specifier_string
, (char*) "BBBB" },
33 { 'm', specifier_machine_id
, NULL
},
34 { 'B', specifier_boot_id
, NULL
},
35 { 'H', specifier_host_name
, NULL
},
36 { 'v', specifier_kernel_release
, NULL
},
40 _cleanup_free_
char *w
= NULL
;
43 r
= specifier_printf("xxx a=%a b=%b yyy", table
, NULL
, &w
);
48 assert_se(streq(w
, "xxx a=AAAA b=BBBB yyy"));
51 r
= specifier_printf("machine=%m, boot=%B, host=%H, version=%v", table
, NULL
, &w
);
57 static void test_str_in_set(void) {
58 assert_se(STR_IN_SET("x", "x", "y", "z"));
59 assert_se(!STR_IN_SET("X", "x", "y", "z"));
60 assert_se(!STR_IN_SET("", "x", "y", "z"));
61 assert_se(STR_IN_SET("x", "w", "x"));
64 static void test_strptr_in_set(void) {
65 assert_se(STRPTR_IN_SET("x", "x", "y", "z"));
66 assert_se(!STRPTR_IN_SET("X", "x", "y", "z"));
67 assert_se(!STRPTR_IN_SET("", "x", "y", "z"));
68 assert_se(STRPTR_IN_SET("x", "w", "x"));
70 assert_se(!STRPTR_IN_SET(NULL
, "x", "y", "z"));
71 assert_se(!STRPTR_IN_SET(NULL
, ""));
72 /* strv cannot contain a null, hence the result below */
73 assert_se(!STRPTR_IN_SET(NULL
, NULL
));
76 static const char* const input_table_multiple
[] = {
83 static const char* const input_table_one
[] = {
88 static const char* const input_table_none
[] = {
92 static const char* const input_table_two_empties
[] = {
98 static const char* const input_table_one_empty
[] = {
104 static const char* const input_table_quotes
[] = {
112 #define QUOTES_STRING \
119 static const char * const input_table_spaces
[] = {
127 #define SPACES_STRING \
134 static void test_strv_find(void) {
135 assert_se(strv_find((char **)input_table_multiple
, "three"));
136 assert_se(!strv_find((char **)input_table_multiple
, "four"));
139 static void test_strv_find_prefix(void) {
140 assert_se(strv_find_prefix((char **)input_table_multiple
, "o"));
141 assert_se(strv_find_prefix((char **)input_table_multiple
, "one"));
142 assert_se(strv_find_prefix((char **)input_table_multiple
, ""));
143 assert_se(!strv_find_prefix((char **)input_table_multiple
, "xxx"));
144 assert_se(!strv_find_prefix((char **)input_table_multiple
, "onee"));
147 static void test_strv_find_startswith(void) {
150 r
= strv_find_startswith((char **)input_table_multiple
, "o");
151 assert_se(r
&& streq(r
, "ne"));
153 r
= strv_find_startswith((char **)input_table_multiple
, "one");
154 assert_se(r
&& streq(r
, ""));
156 r
= strv_find_startswith((char **)input_table_multiple
, "");
157 assert_se(r
&& streq(r
, "one"));
159 assert_se(!strv_find_startswith((char **)input_table_multiple
, "xxx"));
160 assert_se(!strv_find_startswith((char **)input_table_multiple
, "onee"));
163 static void test_strv_join(void) {
164 _cleanup_free_
char *p
= NULL
, *q
= NULL
, *r
= NULL
, *s
= NULL
, *t
= NULL
, *v
= NULL
, *w
= NULL
;
166 p
= strv_join((char **)input_table_multiple
, ", ");
168 assert_se(streq(p
, "one, two, three"));
170 q
= strv_join((char **)input_table_multiple
, ";");
172 assert_se(streq(q
, "one;two;three"));
174 r
= strv_join((char **)input_table_multiple
, NULL
);
176 assert_se(streq(r
, "one two three"));
178 s
= strv_join((char **)input_table_one
, ", ");
180 assert_se(streq(s
, "one"));
182 t
= strv_join((char **)input_table_none
, ", ");
184 assert_se(streq(t
, ""));
186 v
= strv_join((char **)input_table_two_empties
, ", ");
188 assert_se(streq(v
, ", "));
190 w
= strv_join((char **)input_table_one_empty
, ", ");
192 assert_se(streq(w
, ""));
195 static void test_strv_quote_unquote(const char* const *split
, const char *quoted
) {
196 _cleanup_free_
char *p
;
197 _cleanup_strv_free_
char **s
= NULL
;
201 p
= strv_join_quoted((char **)split
);
203 printf("-%s- --- -%s-\n", p
, quoted
); /* fprintf deals with NULL, puts does not */
205 assert_se(streq(p
, quoted
));
207 r
= strv_split_extract(&s
, quoted
, WHITESPACE
, EXTRACT_QUOTES
);
208 assert_se(r
== (int) strv_length(s
));
212 assert_se(streq(*t
, *split
));
217 static void test_strv_unquote(const char *quoted
, char **list
) {
218 _cleanup_strv_free_
char **s
;
219 _cleanup_free_
char *j
;
224 r
= strv_split_extract(&s
, quoted
, WHITESPACE
, EXTRACT_QUOTES
);
225 assert_se(r
== (int) strv_length(list
));
227 j
= strv_join(s
, " | ");
232 assert_se(streq(list
[i
++], *t
));
234 assert_se(list
[i
] == NULL
);
237 static void test_invalid_unquote(const char *quoted
) {
241 r
= strv_split_extract(&s
, quoted
, WHITESPACE
, EXTRACT_QUOTES
);
242 assert_se(s
== NULL
);
243 assert_se(r
== -EINVAL
);
246 static void test_strv_split(void) {
249 _cleanup_strv_free_
char **l
= NULL
;
250 const char str
[] = "one,two,three";
252 l
= strv_split(str
, ",");
257 assert_se(streq(*s
, input_table_multiple
[i
++]));
261 static void test_strv_split_extract(void) {
262 _cleanup_strv_free_
char **l
= NULL
;
263 const char *str
= ":foo\\:bar::waldo:";
266 r
= strv_split_extract(&l
, str
, ":", EXTRACT_DONT_COALESCE_SEPARATORS
);
267 assert_se(r
== (int) strv_length(l
));
268 assert_se(streq_ptr(l
[0], ""));
269 assert_se(streq_ptr(l
[1], "foo:bar"));
270 assert_se(streq_ptr(l
[2], ""));
271 assert_se(streq_ptr(l
[3], "waldo"));
272 assert_se(streq_ptr(l
[4], ""));
273 assert_se(streq_ptr(l
[5], NULL
));
276 static void test_strv_split_newlines(void) {
279 _cleanup_strv_free_
char **l
= NULL
;
280 const char str
[] = "one\ntwo\nthree";
282 l
= strv_split_newlines(str
);
287 assert_se(streq(*s
, input_table_multiple
[i
++]));
291 static void test_strv_split_nulstr(void) {
292 _cleanup_strv_free_
char **l
= NULL
;
293 const char nulstr
[] = "str0\0str1\0str2\0str3\0";
295 l
= strv_split_nulstr (nulstr
);
298 assert_se(streq(l
[0], "str0"));
299 assert_se(streq(l
[1], "str1"));
300 assert_se(streq(l
[2], "str2"));
301 assert_se(streq(l
[3], "str3"));
304 static void test_strv_parse_nulstr(void) {
305 _cleanup_strv_free_
char **l
= NULL
;
306 const char nulstr
[] = "fuck\0fuck2\0fuck3\0\0fuck5\0\0xxx";
308 l
= strv_parse_nulstr(nulstr
, sizeof(nulstr
)-1);
310 puts("Parse nulstr:");
313 assert_se(streq(l
[0], "fuck"));
314 assert_se(streq(l
[1], "fuck2"));
315 assert_se(streq(l
[2], "fuck3"));
316 assert_se(streq(l
[3], ""));
317 assert_se(streq(l
[4], "fuck5"));
318 assert_se(streq(l
[5], ""));
319 assert_se(streq(l
[6], "xxx"));
322 static void test_strv_overlap(void) {
323 const char * const input_table
[] = {
329 const char * const input_table_overlap
[] = {
333 const char * const input_table_unique
[] = {
340 assert_se(strv_overlap((char **)input_table
, (char**)input_table_overlap
));
341 assert_se(!strv_overlap((char **)input_table
, (char**)input_table_unique
));
344 static void test_strv_sort(void) {
345 const char* input_table
[] = {
349 "CAPITAL LETTERS FIRST",
354 strv_sort((char **)input_table
);
356 assert_se(streq(input_table
[0], "CAPITAL LETTERS FIRST"));
357 assert_se(streq(input_table
[1], "apple"));
358 assert_se(streq(input_table
[2], "banana"));
359 assert_se(streq(input_table
[3], "citrus"));
360 assert_se(streq(input_table
[4], "durian"));
363 static void test_strv_extend_strv_concat(void) {
364 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
;
366 a
= strv_new("without", "suffix", NULL
);
367 b
= strv_new("with", "suffix", NULL
);
371 assert_se(strv_extend_strv_concat(&a
, b
, "_suffix") >= 0);
373 assert_se(streq(a
[0], "without"));
374 assert_se(streq(a
[1], "suffix"));
375 assert_se(streq(a
[2], "with_suffix"));
376 assert_se(streq(a
[3], "suffix_suffix"));
379 static void test_strv_extend_strv(void) {
380 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
, **n
= NULL
;
382 a
= strv_new("abc", "def", "ghi", NULL
);
383 b
= strv_new("jkl", "mno", "abc", "pqr", NULL
);
387 assert_se(strv_extend_strv(&a
, b
, true) == 3);
389 assert_se(streq(a
[0], "abc"));
390 assert_se(streq(a
[1], "def"));
391 assert_se(streq(a
[2], "ghi"));
392 assert_se(streq(a
[3], "jkl"));
393 assert_se(streq(a
[4], "mno"));
394 assert_se(streq(a
[5], "pqr"));
395 assert_se(strv_length(a
) == 6);
397 assert_se(strv_extend_strv(&n
, b
, false) >= 0);
398 assert_se(streq(n
[0], "jkl"));
399 assert_se(streq(n
[1], "mno"));
400 assert_se(streq(n
[2], "abc"));
401 assert_se(streq(n
[3], "pqr"));
402 assert_se(strv_length(n
) == 4);
405 static void test_strv_extend(void) {
406 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
;
408 a
= strv_new("test", "test1", NULL
);
410 assert_se(strv_extend(&a
, "test2") >= 0);
411 assert_se(strv_extend(&b
, "test3") >= 0);
413 assert_se(streq(a
[0], "test"));
414 assert_se(streq(a
[1], "test1"));
415 assert_se(streq(a
[2], "test2"));
416 assert_se(streq(b
[0], "test3"));
419 static void test_strv_extendf(void) {
420 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
;
422 a
= strv_new("test", "test1", NULL
);
424 assert_se(strv_extendf(&a
, "test2 %s %d %s", "foo", 128, "bar") >= 0);
425 assert_se(strv_extendf(&b
, "test3 %s %s %d", "bar", "foo", 128) >= 0);
427 assert_se(streq(a
[0], "test"));
428 assert_se(streq(a
[1], "test1"));
429 assert_se(streq(a
[2], "test2 foo 128 bar"));
430 assert_se(streq(b
[0], "test3 bar foo 128"));
433 static void test_strv_foreach(void) {
434 _cleanup_strv_free_
char **a
;
438 a
= strv_new("one", "two", "three", NULL
);
442 STRV_FOREACH(check
, a
) {
443 assert_se(streq(*check
, input_table_multiple
[i
++]));
447 static void test_strv_foreach_backwards(void) {
448 _cleanup_strv_free_
char **a
;
452 a
= strv_new("one", "two", "three", NULL
);
456 STRV_FOREACH_BACKWARDS(check
, a
)
457 assert_se(streq_ptr(*check
, input_table_multiple
[i
--]));
459 STRV_FOREACH_BACKWARDS(check
, (char**) NULL
)
460 assert_not_reached("Let's see that we check empty strv right, too.");
462 STRV_FOREACH_BACKWARDS(check
, (char**) { NULL
})
463 assert_not_reached("Let's see that we check empty strv right, too.");
466 static void test_strv_foreach_pair(void) {
467 _cleanup_strv_free_
char **a
= NULL
;
470 a
= strv_new("pair_one", "pair_one",
471 "pair_two", "pair_two",
472 "pair_three", "pair_three",
475 STRV_FOREACH_PAIR(x
, y
, a
) {
476 assert_se(streq(*x
, *y
));
480 static void test_strv_from_stdarg_alloca_one(char **l
, const char *first
, ...) {
484 j
= strv_from_stdarg_alloca(first
);
487 assert_se(streq_ptr(l
[i
], j
[i
]));
494 static void test_strv_from_stdarg_alloca(void) {
495 test_strv_from_stdarg_alloca_one(STRV_MAKE("foo", "bar"), "foo", "bar", NULL
);
496 test_strv_from_stdarg_alloca_one(STRV_MAKE("foo"), "foo", NULL
);
497 test_strv_from_stdarg_alloca_one(STRV_MAKE_EMPTY
, NULL
);
500 static void test_strv_push_prepend(void) {
501 _cleanup_strv_free_
char **a
= NULL
;
503 a
= strv_new("foo", "bar", "three", NULL
);
505 assert_se(strv_push_prepend(&a
, strdup("first")) >= 0);
506 assert_se(streq(a
[0], "first"));
507 assert_se(streq(a
[1], "foo"));
508 assert_se(streq(a
[2], "bar"));
509 assert_se(streq(a
[3], "three"));
512 assert_se(strv_consume_prepend(&a
, strdup("first2")) >= 0);
513 assert_se(streq(a
[0], "first2"));
514 assert_se(streq(a
[1], "first"));
515 assert_se(streq(a
[2], "foo"));
516 assert_se(streq(a
[3], "bar"));
517 assert_se(streq(a
[4], "three"));
521 static void test_strv_push(void) {
522 _cleanup_strv_free_
char **a
= NULL
;
525 assert_se(i
= strdup("foo"));
526 assert_se(strv_push(&a
, i
) >= 0);
528 assert_se(i
= strdup("a"));
529 assert_se(j
= strdup("b"));
530 assert_se(strv_push_pair(&a
, i
, j
) >= 0);
532 assert_se(streq_ptr(a
[0], "foo"));
533 assert_se(streq_ptr(a
[1], "a"));
534 assert_se(streq_ptr(a
[2], "b"));
535 assert_se(streq_ptr(a
[3], NULL
));
538 static void test_strv_equal(void) {
539 _cleanup_strv_free_
char **a
= NULL
;
540 _cleanup_strv_free_
char **b
= NULL
;
541 _cleanup_strv_free_
char **c
= NULL
;
543 a
= strv_new("one", "two", "three", NULL
);
545 b
= strv_new("one", "two", "three", NULL
);
547 c
= strv_new("one", "two", "three", "four", NULL
);
550 assert_se(strv_equal(a
, a
));
551 assert_se(strv_equal(a
, b
));
552 assert_se(strv_equal(NULL
, NULL
));
554 assert_se(!strv_equal(a
, c
));
555 assert_se(!strv_equal(b
, c
));
556 assert_se(!strv_equal(b
, NULL
));
559 static void test_strv_is_uniq(void) {
560 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
, **c
= NULL
, **d
= NULL
;
562 a
= strv_new(NULL
, NULL
);
564 assert_se(strv_is_uniq(a
));
566 b
= strv_new("foo", NULL
);
568 assert_se(strv_is_uniq(b
));
570 c
= strv_new("foo", "bar", NULL
);
572 assert_se(strv_is_uniq(c
));
574 d
= strv_new("foo", "bar", "waldo", "bar", "piep", NULL
);
576 assert_se(!strv_is_uniq(d
));
579 static void test_strv_reverse(void) {
580 _cleanup_strv_free_
char **a
= NULL
, **b
= NULL
, **c
= NULL
, **d
= NULL
;
582 a
= strv_new(NULL
, NULL
);
586 assert_se(strv_isempty(a
));
588 b
= strv_new("foo", NULL
);
591 assert_se(streq_ptr(b
[0], "foo"));
592 assert_se(streq_ptr(b
[1], NULL
));
594 c
= strv_new("foo", "bar", NULL
);
597 assert_se(streq_ptr(c
[0], "bar"));
598 assert_se(streq_ptr(c
[1], "foo"));
599 assert_se(streq_ptr(c
[2], NULL
));
601 d
= strv_new("foo", "bar", "waldo", NULL
);
604 assert_se(streq_ptr(d
[0], "waldo"));
605 assert_se(streq_ptr(d
[1], "bar"));
606 assert_se(streq_ptr(d
[2], "foo"));
607 assert_se(streq_ptr(d
[3], NULL
));
610 static void test_strv_shell_escape(void) {
611 _cleanup_strv_free_
char **v
= NULL
;
613 v
= strv_new("foo:bar", "bar,baz", "wal\\do", NULL
);
615 assert_se(strv_shell_escape(v
, ",:"));
616 assert_se(streq_ptr(v
[0], "foo\\:bar"));
617 assert_se(streq_ptr(v
[1], "bar\\,baz"));
618 assert_se(streq_ptr(v
[2], "wal\\\\do"));
619 assert_se(streq_ptr(v
[3], NULL
));
622 static void test_strv_skip_one(char **a
, size_t n
, char **b
) {
624 assert_se(strv_equal(a
, b
));
627 static void test_strv_skip(void) {
628 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 0, STRV_MAKE("foo", "bar", "baz"));
629 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 1, STRV_MAKE("bar", "baz"));
630 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 2, STRV_MAKE("baz"));
631 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 3, STRV_MAKE(NULL
));
632 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 4, STRV_MAKE(NULL
));
633 test_strv_skip_one(STRV_MAKE("foo", "bar", "baz"), 55, STRV_MAKE(NULL
));
635 test_strv_skip_one(STRV_MAKE("quux"), 0, STRV_MAKE("quux"));
636 test_strv_skip_one(STRV_MAKE("quux"), 1, STRV_MAKE(NULL
));
637 test_strv_skip_one(STRV_MAKE("quux"), 55, STRV_MAKE(NULL
));
639 test_strv_skip_one(STRV_MAKE(NULL
), 0, STRV_MAKE(NULL
));
640 test_strv_skip_one(STRV_MAKE(NULL
), 1, STRV_MAKE(NULL
));
641 test_strv_skip_one(STRV_MAKE(NULL
), 55, STRV_MAKE(NULL
));
644 static void test_strv_extend_n(void) {
645 _cleanup_strv_free_
char **v
= NULL
;
647 v
= strv_new("foo", "bar", NULL
);
650 assert_se(strv_extend_n(&v
, "waldo", 3) >= 0);
651 assert_se(strv_extend_n(&v
, "piep", 2) >= 0);
653 assert_se(streq(v
[0], "foo"));
654 assert_se(streq(v
[1], "bar"));
655 assert_se(streq(v
[2], "waldo"));
656 assert_se(streq(v
[3], "waldo"));
657 assert_se(streq(v
[4], "waldo"));
658 assert_se(streq(v
[5], "piep"));
659 assert_se(streq(v
[6], "piep"));
660 assert_se(v
[7] == NULL
);
664 assert_se(strv_extend_n(&v
, "foo", 1) >= 0);
665 assert_se(strv_extend_n(&v
, "bar", 0) >= 0);
667 assert_se(streq(v
[0], "foo"));
668 assert_se(v
[1] == NULL
);
671 static void test_strv_make_nulstr_one(char **l
) {
672 _cleanup_free_
char *b
= NULL
, *c
= NULL
;
673 _cleanup_strv_free_
char **q
= NULL
;
674 const char *s
= NULL
;
678 assert_se(strv_make_nulstr(l
, &b
, &n
) >= 0);
679 assert_se(q
= strv_parse_nulstr(b
, n
));
680 assert_se(strv_equal(l
, q
));
682 assert_se(strv_make_nulstr(q
, &c
, &m
) >= 0);
684 assert_se(memcmp(b
, c
, m
) == 0);
687 assert_se(streq(s
, l
[i
++]));
688 assert_se(i
== strv_length(l
));
691 static void test_strv_make_nulstr(void) {
692 test_strv_make_nulstr_one(NULL
);
693 test_strv_make_nulstr_one(STRV_MAKE(NULL
));
694 test_strv_make_nulstr_one(STRV_MAKE("foo"));
695 test_strv_make_nulstr_one(STRV_MAKE("foo", "bar"));
696 test_strv_make_nulstr_one(STRV_MAKE("foo", "bar", "quuux"));
699 static void test_foreach_string(void) {
700 const char * const t
[] = {
709 FOREACH_STRING(x
, "foo", "bar", "waldo")
710 assert_se(streq_ptr(t
[i
++], x
));
714 FOREACH_STRING(x
, "zzz")
715 assert_se(streq(x
, "zzz"));
718 static void test_strv_fnmatch(void) {
719 _cleanup_strv_free_
char **v
= NULL
;
721 assert_se(!strv_fnmatch(STRV_MAKE_EMPTY
, "a", 0));
723 v
= strv_new("*\\*", NULL
);
724 assert_se(!strv_fnmatch(v
, "\\", 0));
725 assert_se(strv_fnmatch(v
, "\\", FNM_NOESCAPE
));
728 int main(int argc
, char *argv
[]) {
729 test_specifier_printf();
731 test_strptr_in_set();
733 test_strv_foreach_backwards();
734 test_strv_foreach_pair();
736 test_strv_find_prefix();
737 test_strv_find_startswith();
740 test_strv_quote_unquote(input_table_multiple
, "\"one\" \"two\" \"three\"");
741 test_strv_quote_unquote(input_table_one
, "\"one\"");
742 test_strv_quote_unquote(input_table_none
, "");
743 test_strv_quote_unquote(input_table_one_empty
, "\"\"");
744 test_strv_quote_unquote(input_table_two_empties
, "\"\" \"\"");
745 test_strv_quote_unquote(input_table_quotes
, QUOTES_STRING
);
746 test_strv_quote_unquote(input_table_spaces
, SPACES_STRING
);
748 test_strv_unquote(" foo=bar \"waldo\" zzz ", STRV_MAKE("foo=bar", "waldo", "zzz"));
749 test_strv_unquote("", STRV_MAKE_EMPTY
);
750 test_strv_unquote(" ", STRV_MAKE_EMPTY
);
751 test_strv_unquote(" ", STRV_MAKE_EMPTY
);
752 test_strv_unquote(" x", STRV_MAKE("x"));
753 test_strv_unquote("x ", STRV_MAKE("x"));
754 test_strv_unquote(" x ", STRV_MAKE("x"));
755 test_strv_unquote(" \"x\" ", STRV_MAKE("x"));
756 test_strv_unquote(" 'x' ", STRV_MAKE("x"));
757 test_strv_unquote(" 'x\"' ", STRV_MAKE("x\""));
758 test_strv_unquote(" \"x'\" ", STRV_MAKE("x'"));
759 test_strv_unquote("a '--b=c \"d e\"'", STRV_MAKE("a", "--b=c \"d e\""));
761 /* trailing backslashes */
762 test_strv_unquote(" x\\\\", STRV_MAKE("x\\"));
763 test_invalid_unquote(" x\\");
765 test_invalid_unquote("a --b='c \"d e\"''");
766 test_invalid_unquote("a --b='c \"d e\" '\"");
767 test_invalid_unquote("a --b='c \"d e\"garbage");
768 test_invalid_unquote("'");
769 test_invalid_unquote("\"");
770 test_invalid_unquote("'x'y'g");
773 test_strv_split_extract();
774 test_strv_split_newlines();
775 test_strv_split_nulstr();
776 test_strv_parse_nulstr();
779 test_strv_extend_strv();
780 test_strv_extend_strv_concat();
783 test_strv_from_stdarg_alloca();
784 test_strv_push_prepend();
789 test_strv_shell_escape();
791 test_strv_extend_n();
792 test_strv_make_nulstr();
794 test_foreach_string();