From dc6d7befaa0de08814d4aaf85838faaf3fec8671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Wed, 22 Sep 2021 19:49:33 +0300 Subject: Fix parcini treating one key characters as errors --- src/tests/parcini.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/tests') diff --git a/src/tests/parcini.c b/src/tests/parcini.c index f53ab09..90d5997 100644 --- a/src/tests/parcini.c +++ b/src/tests/parcini.c @@ -35,7 +35,7 @@ test_parcini_parse_file(void) asserteq(res, PARCINI_KEYVALUE); asserteq(line.lineno, 3); asserteq(strcmp(line.section, ""), 0); - asserteq(strcmp(line.key, "key3"), 0); + asserteq(strcmp(line.key, "3"), 0); asserteq(line.value.type, PARCINI_VALUE_BOOLEAN); asserteq(line.value.value.boolean, false); @@ -115,14 +115,19 @@ test_parcini_parse_file(void) /* line 15 */ res = parcini_parse_next_line(parser, &line); - asserteq(res, PARCINI_EMPTY_LINE); + asserteq(res, PARCINI_KEY_PARSE_ERROR); asserteq(line.lineno, 15); /* line 16 */ res = parcini_parse_next_line(parser, &line); - asserteq(res, PARCINI_SECTION_PARSE_ERROR); + asserteq(res, PARCINI_EMPTY_LINE); asserteq(line.lineno, 16); + /* line 17 */ + res = parcini_parse_next_line(parser, &line); + asserteq(res, PARCINI_SECTION_PARSE_ERROR); + asserteq(line.lineno, 17); + /* EOF */ res = parcini_parse_next_line(parser, &line); asserteq(res, PARCINI_EOF); -- cgit v1.2.3