aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-12-16 09:09:03 +0100
committerPřemysl Eric Janouch <p@janouch.name>2024-12-16 09:09:03 +0100
commit32cbb152660566042ac25b00de4b19b1c90c0f5c (patch)
tree82fbbd3e655386aabb2e3bd4911c2c537e44212e /tests
parent149938cc445f99b1aa40c490014aad72cf698dec (diff)
downloadliberty-32cbb152660566042ac25b00de4b19b1c90c0f5c.tar.gz
liberty-32cbb152660566042ac25b00de4b19b1c90c0f5c.tar.xz
liberty-32cbb152660566042ac25b00de4b19b1c90c0f5c.zip
Serialize integer-ish config keys properly
Diffstat (limited to 'tests')
-rw-r--r--tests/liberty.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/liberty.c b/tests/liberty.c
index 92647ae..fddfb2c 100644
--- a/tests/liberty.c
+++ b/tests/liberty.c
@@ -647,7 +647,7 @@ static const struct config_schema g_config_test[] =
.type = CONFIG_ITEM_INTEGER,
.validate = test_config_validate_nonnegative,
.default_ = "1" },
- { .name = "foobar",
+ { .name = "123",
.type = CONFIG_ITEM_STRING,
.default_ = "\"qux\\x01`\" \"\"`a`" },
{}
@@ -676,10 +676,11 @@ test_config (void)
config_item_destroy (invalid);
hard_assert (!strcmp ("qux\001`a",
- config_item_get (config.root, "top.foobar", NULL)->value.string.str));
+ config_item_get (config.root, "top.123", NULL)->value.string.str));
struct str s = str_make ();
config_item_write (config.root, true, &s);
+ print_debug ("%s", s.str);
struct config_item *parsed = config_item_parse (s.str, s.len, false, NULL);
hard_assert (parsed);
config_item_destroy (parsed);