From 78ca904d99e489697cfa7f7053625b76886b3d2a Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 18:47:24 -1000 Subject: Test a number left empty in cgitrc --- tests/t0205-config.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/t0205-config.sh b/tests/t0205-config.sh index 8999497..5931f4c 100755 --- a/tests/t0205-config.sh +++ b/tests/t0205-config.sh @@ -208,6 +208,15 @@ test_expect_success 'a word where a number belongs is reported' ' test_grep -F "Reading enable-blame=on in $PWD/outerrc line 2 as 0, since it is not a whole number" err ' +# A number left empty reads as 0 as well, so it is logged as a word is. +test_expect_success 'an empty number is reported' ' + cgitrc_repo emptyrc foo cache-size= && + cgit_rc emptyrc "url=foo/" >tmp 2>err && + test_grep "^Status: 200" tmp && + test_grep -F "Reading cache-size= in $PWD/emptyrc line 3 as 0, since it is not a whole number" err && + test_line_count = 1 err +' + test_expect_success 'a word in a scanned git config is reported' ' git clone -q --bare repos/foo/.git wordscan/foo.git && git -C wordscan/foo.git config cgit.hide true && -- cgit 2.12.1