commit 47b8533dc0ef587a88cdc14e97716fe7944ef603 from: Omar Polo date: Fri Jun 28 18:43:26 2024 UTC test: simulate the empty documents This forces the test to issue a parser_parse() with a zero-sized buffer so that we can properly test empty documents as well in the regression test. Would have prevented https://codeberg.org/telescope-browser/telescope/pulls/32 commit - d92ddc8dc46345e47f1ab1626e203ec3c59569c4 commit + 47b8533dc0ef587a88cdc14e97716fe7944ef603 blob - 46c3019c7d363a9814cfa740118fe39b12f8fe2e blob + a6229982e2ac6fe546a1dae960f24d7b7e962e27 --- test/gmiparser.c +++ test/gmiparser.c @@ -66,8 +66,15 @@ main(void) for (;;) { if ((r = read(0, buf, sizeof(buf))) == -1) err(1, "read"); - if (r == 0) + if (r == 0) { + /* + * Force a zero-sized write to also test the + * case of an empty document. + */ + if (!parser_parse(&tab.buffer, buf, 0)) + err(1, "parser_parse"); break; + } if (!parser_parse(&tab.buffer, buf, r)) err(1, "parser_parse"); } blob - /dev/null blob + e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 (mode 644)