summaryrefslogtreecommitdiff
path: root/src/test/test-escape.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-06-23 20:43:48 -0400
committerSven Eden <yamakuzure@gmx.net>2017-07-25 09:46:53 +0200
commit9742b1e43855b1599bd52ff95af995d9a9d35eac (patch)
tree123cd2ec860d783850b0c752e9b7301315b582b1 /src/test/test-escape.c
parenta5b55c5ad6cdfc629b29ac7feefe99af850dfc3a (diff)
tests: add tests for environment serialization
Diffstat (limited to 'src/test/test-escape.c')
-rw-r--r--src/test/test-escape.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test-escape.c b/src/test/test-escape.c
index 20b54c6ab..e7bc49dd9 100644
--- a/src/test/test-escape.c
+++ b/src/test/test-escape.c
@@ -69,6 +69,14 @@ static void test_cunescape(void) {
assert_se(cunescape("\\073", 0, &unescaped) >= 0);
assert_se(streq_ptr(unescaped, ";"));
+ unescaped = mfree(unescaped);
+
+ assert_se(cunescape("A=A\\\\x0aB", 0, &unescaped) >= 0);
+ assert_se(streq_ptr(unescaped, "A=A\\x0aB"));
+ unescaped = mfree(unescaped);
+
+ assert_se(cunescape("A=A\\\\x0aB", UNESCAPE_RELAX, &unescaped) >= 0);
+ assert_se(streq_ptr(unescaped, "A=A\\x0aB"));
}
#if 0 /// UNNEEDED by elogind