chiark / gitweb /
Treat a trailing backslash as an error
[elogind.git] / src / test / test-strv.c
index 0b78086ea9a0b202204059d26589825fd9b5e3ec..f343eab7c63d3eec3f2676846f744ef82da3f99d 100644 (file)
@@ -520,6 +520,10 @@ int main(int argc, char *argv[]) {
         test_strv_unquote("  \"x'\"   ", STRV_MAKE("x'"));
         test_strv_unquote("a  '--b=c \"d e\"'", STRV_MAKE("a", "--b=c \"d e\""));
 
+        /* trailing backslashes */
+        test_strv_unquote("  x\\\\", STRV_MAKE("x\\"));
+        test_invalid_unquote("  x\\");
+
         test_invalid_unquote("a  --b='c \"d e\"''");
         test_invalid_unquote("a  --b='c \"d e\" '\"");
         test_invalid_unquote("a  --b='c \"d e\"garbage");