Index: nih/tests/test_string.c |
diff --git a/nih/tests/test_string.c b/nih/tests/test_string.c |
index 82c20f66895a689d6834758cd860cae770664136..2e16f97291cd6bbfbb13dd61eaca0ddc868155eb 100644 |
--- a/nih/tests/test_string.c |
+++ b/nih/tests/test_string.c |
@@ -663,6 +663,25 @@ test_str_split (void) |
nih_free (array); |
} |
+ |
+ /* Check that we can give a string with only repeating |
+ * delimiters, enable repeat, and we end up with a one-element |
+ * array that only contains a NULL pointer. |
+ */ |
+ TEST_FEATURE ("with empty string except for delimiters"); |
+ TEST_ALLOC_FAIL { |
+ array = nih_str_split (NULL, " ", " ", TRUE); |
+ |
+ if (test_alloc_failed) { |
+ TEST_EQ_P (array, NULL); |
+ continue; |
+ } |
+ |
+ TEST_ALLOC_SIZE (array, sizeof (char *)); |
+ TEST_EQ_P (array[0], NULL); |
+ |
+ nih_free (array); |
+ } |
} |
void |