From f545be725df9195a5b5897ad95a0220acf10f148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sun, 14 Aug 2022 18:03:18 +0200 Subject: Extend string syntax in config And actually test the results of string parsing. --- tests/liberty.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/liberty.c b/tests/liberty.c index dc445d8..3d932d5 100644 --- a/tests/liberty.c +++ b/tests/liberty.c @@ -1,7 +1,7 @@ /* * tests/liberty.c * - * Copyright (c) 2015 - 2016, Přemysl Eric Janouch + * Copyright (c) 2015 - 2022, Přemysl Eric Janouch * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted. @@ -649,7 +649,7 @@ static struct config_schema g_config_test[] = .default_ = "1" }, { .name = "foobar", .type = CONFIG_ITEM_STRING, - .default_ = "\"qux\\x01\"" }, + .default_ = "\"qux\\x01`\" \"\"`a`" }, {} }; @@ -675,6 +675,9 @@ test_config (void) "top.bar", NULL), invalid, NULL)); config_item_destroy (invalid); + hard_assert (!strcmp ("qux\001`a", + config_item_get (config.root, "top.foobar", NULL)->value.string.str)); + struct str s = str_make (); config_item_write (config.root, true, &s); struct config_item *parsed = config_item_parse (s.str, s.len, false, NULL); -- cgit v1.2.3