summaryrefslogtreecommitdiff
path: root/src/test/test-util.c
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2015-07-24 09:29:46 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2015-07-24 09:29:46 +0000
commit14e685c29d5b317b815e3e9f056648027852b07e (patch)
treebe251d64d02f91ebafddaf5f3c868399b17b3970 /src/test/test-util.c
parent7ee7b225bd2fc3e7a3980f5fb7b10dfc6e205578 (diff)
unquote_first_word: parse ` '' ` as an empty argument instead of no argument
Diffstat (limited to 'src/test/test-util.c')
-rw-r--r--src/test/test-util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/test-util.c b/src/test/test-util.c
index 72fbc345c2..ab40f0076b 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -1518,6 +1518,17 @@ static void test_unquote_first_word(void) {
assert_se(streq(t, "\\w+\b"));
free(t);
assert_se(p == original + 5);
+
+ p = original = "-N ''";
+ assert_se(unquote_first_word(&p, &t, UNQUOTE_CUNESCAPE) > 0);
+ assert_se(streq(t, "-N"));
+ free(t);
+ assert_se(p == original + 3);
+
+ assert_se(unquote_first_word(&p, &t, UNQUOTE_CUNESCAPE) > 0);
+ assert_se(streq(t, ""));
+ free(t);
+ assert_se(p == original + 5);
}
static void test_unquote_first_word_and_warn(void) {