summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-10 11:56:04 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-10 11:56:04 +0200
commit8ebac1f9a681ce1c6287e7c6a1b3093b00fb0c5a (patch)
tree6dfc1c0affd1048fee05168f82dd0cf83269eb3d /src/test
parentf3ee629711783333005c41e21d66841268b80f70 (diff)
util: fix unicode decoding in unquote_first_word()
Diffstat (limited to 'src/test')
-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 7af41bcb18..77e7400bfc 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -1376,6 +1376,17 @@ static void test_unquote_first_word(void) {
assert_se(streq(t, "foobax6ar"));
free(t);
assert_se(p == original + 13);
+
+ p = original = " f\\u00f6o \"pi\\U0001F4A9le\" ";
+ assert_se(unquote_first_word(&p, &t, UNQUOTE_CUNESCAPE) > 0);
+ assert_se(streq(t, "föo"));
+ free(t);
+ assert_se(p == original + 13);
+
+ assert_se(unquote_first_word(&p, &t, UNQUOTE_CUNESCAPE) > 0);
+ assert_se(streq(t, "pi\360\237\222\251le"));
+ free(t);
+ assert_se(p == original + 32);
}
static void test_unquote_many_words(void) {