]> granicus.if.org Git - sudo/commitdiff
Test strsplit behavior with an empty string.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 18 Jun 2015 22:14:20 +0000 (16:14 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 18 Jun 2015 22:14:20 +0000 (16:14 -0600)
lib/util/regress/strsplit/strsplit_test.c

index 502ba6f6e62565330ca6fcb36cbb4513cfab76a0..ad46fb263f6f8c1b908b2875a95c1484a7ca6277 100644 (file)
@@ -65,12 +65,15 @@ static const char test3_in[] = "vi -r  -R abc\tdef ";
 static const char *test3_out[] = { "vi", "-r", "-R", "abc", "def", NULL };
 static const char test4_in[] = "vi -r  -R abc\tdef ";
 static const char *test4_out[] = { "vi", "-r", "-R", "abc", NULL };
+static const char test5_in[] = "";
+static const char *test5_out[] = { NULL };
 
 static struct strsplit_test test_data[] = {
     { test1_in, sizeof(test1_in) - 1, test1_out },
     { test2_in, sizeof(test2_in) - 1, test2_out },
     { test3_in, sizeof(test3_in) - 1, test3_out },
     { test4_in, sizeof(test4_in) - 5, test4_out },
+    { test5_in, sizeof(test5_in) - 1, test5_out },
     { NULL, 0, NULL }
 };