summaryrefslogtreecommitdiff
path: root/src/test/test-util.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-07-24 19:49:29 +0200
committerDaniel Mack <github@zonque.org>2015-07-24 19:49:29 +0200
commitb83b298102e1abd03565052cb2bc60234e09b692 (patch)
tree84543af49bd010f6ca5ef12c4ac194cd3dfcaff5 /src/test/test-util.c
parent0b071992bbdf6a2bfdbe1a064a2f8270be8779c4 (diff)
parent14e685c29d5b317b815e3e9f056648027852b07e (diff)
Merge pull request #704 from richardmaw-codethink/empty-arg-unquote
unquote_first_word: parse ` '' ` as an empty argument instead of no arg
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 7906c4d7bb..f43433baa1 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -1689,6 +1689,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) {