- a = strv_new("abc", "def", "ghi", NULL);
- b = strv_new("jkl", "mno", "pqr", NULL);
+ a = strv_new("abc", "def", "ghi", NULL);
+ b = strv_new("jkl", "mno", "pqr", NULL);
+ assert_se(a);
+ assert_se(b);
+
+ c = strv_merge(a, b);
+ assert_se(c);
+
+ assert_se(streq(c[0], "abc"));
+ assert_se(streq(c[1], "def"));
+ assert_se(streq(c[2], "ghi"));
+ assert_se(streq(c[3], "jkl"));
+ assert_se(streq(c[4], "mno"));
+ assert_se(streq(c[5], "pqr"));
+
+ assert_se(strv_length(c) == 6);
+}
+
+static void test_strv_append(void) {
+ _cleanup_strv_free_ char **a = NULL, **b = NULL, **c = NULL;
+
+ a = strv_new("test", "test1", NULL);
+ assert_se(a);
+ b = strv_append(a, "test2");
+ c = strv_append(NULL, "test3");
+ assert_se(b);
+ assert_se(c);
+
+ assert_se(streq(b[0], "test"));
+ assert_se(streq(b[1], "test1"));
+ assert_se(streq(b[2], "test2"));
+ assert_se(streq(c[0], "test3"));
+}