From 07049b3d25cbc397dd39c71d32422bfd7c39d814 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 10 Sep 2010 09:19:10 -0400 Subject: Support mutli-line torrc options via the usual backslash syntax --- src/test/test_util.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/test') diff --git a/src/test/test_util.c b/src/test/test_util.c index 8a13597978..84bb5a67f4 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -100,6 +100,9 @@ test_util_config_line(void) "k4#a\n" "k5#abc\n" "k6 val #with comment\n" "kseven \"a quoted 'string\"\n" "k8 \"a \\x71uoted\\n\\\"str\\\\ing\\t\\001\\01\\1\\\"\"\n" + "k9 a line that\\\n spans two lines.\n\n" + "k10 more than\\\n one contin\\\nuation\n" + "k11 \\\ncontinuation at the start\n" , sizeof(buf)); str = buf; @@ -161,7 +164,24 @@ test_util_config_line(void) test_streq(k, "k8"); test_streq(v, "a quoted\n\"str\\ing\t\x01\x01\x01\""); tor_free(k); tor_free(v); + + str = parse_config_line_from_str(str, &k, &v); + test_streq(k, "k9"); + test_streq(v, "a line that spans two lines."); + tor_free(k); tor_free(v); + + str = parse_config_line_from_str(str, &k, &v); + test_streq(k, "k10"); + test_streq(v, "more than one continuation"); + tor_free(k); tor_free(v); + + str = parse_config_line_from_str(str, &k, &v); + test_streq(k, "k11"); + test_streq(v, "continuation at the start"); + tor_free(k); tor_free(v); + test_streq(str, ""); + done: tor_free(k); tor_free(v); -- cgit v1.2.3-54-g00ecf