--- src/test/test-strv.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/src/test/test-strv.c b/src/test/test-strv.c index e96200e..9b51d82 100644 --- a/src/test/test-strv.c +++ b/src/test/test-strv.c @@ -171,6 +171,21 @@ static void test_strv_split(void) { } } +static void test_strv_split_newlines(void) { + unsigned i = 0; + char **s; + _cleanup_strv_free_ char **l = NULL; + const char str[] = "one\ntwo\nthree"; + + l = strv_split_newlines(str); + + assert(l); + + STRV_FOREACH(s, l) { + assert_se(streq(*s, input_table_multiple[i++])); + } +} + static void test_strv_split_nulstr(void) { _cleanup_strv_free_ char **l = NULL; const char nulstr[] = "str0\0str1\0str2\0str3\0"; @@ -375,6 +390,7 @@ int main(int argc, char *argv[]) { test_strv_quote_unquote(input_table_spaces, SPACES_STRING); test_strv_split(); + test_strv_split_newlines(); test_strv_split_nulstr(); test_strv_parse_nulstr(); test_strv_overlap(); -- 1.8.4.2 _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel