summaryrefslogtreecommitdiffstats
path: root/tests/libknot/test_yparser.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-14 16:17:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-14 16:17:58 +0000
commit85e0c8135de3db530a4605f67235844babea1a01 (patch)
tree502437983ead917742e4427d2121b3e1f0dc3b50 /tests/libknot/test_yparser.c
parentAdding debian version 3.3.5-1.1. (diff)
downloadknot-85e0c8135de3db530a4605f67235844babea1a01.tar.xz
knot-85e0c8135de3db530a4605f67235844babea1a01.zip
Merging upstream version 3.3.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/libknot/test_yparser.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/libknot/test_yparser.c b/tests/libknot/test_yparser.c
index 8655096..8b6c31f 100644
--- a/tests/libknot/test_yparser.c
+++ b/tests/libknot/test_yparser.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2021 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/* Copyright (C) 2024 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,6 +27,9 @@ const char *syntax_ok =
" # comment\n"
"a:\n"
"a :\n"
+ "a: \"\"\n"
+ "a: []\n"
+ "a: [ ]\n"
"a : #comment\n"
"\n"
"b: \"b\"\n"
@@ -118,7 +121,7 @@ static void test_syntax_ok(yp_parser_t *yp)
is_int(KNOT_EOK, ret, "set input string");
size_t line = 3;
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < 6; i++) {
ret = yp_parse(yp);
is_int(KNOT_EOK, ret, "parse %i. key0", i);
ok(yp->key_len == 1 && yp->key[0] == 'a' &&
@@ -126,7 +129,7 @@ static void test_syntax_ok(yp_parser_t *yp)
yp->line_count == line + i, "compare %i. key0", i);
}
- line += 4;
+ line += 7;
for (int i = 0; i < 6; i++) {
ret = yp_parse(yp);
is_int(KNOT_EOK, ret, "parse %i. key0 with value", i);