From 6479d8359461ade32efeda62f51b65c2773ce4ba Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 11:58:04 -1000 Subject: Test the log search by case and by committer --- tests/t0103-log.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') diff --git a/tests/t0103-log.sh b/tests/t0103-log.sh index ca7c188..9309b10 100755 --- a/tests/t0103-log.sh +++ b/tests/t0103-log.sh @@ -133,6 +133,25 @@ test_expect_success 'a search lists only the commits it matches' ' test_grep ! "commit 2" tmp ' +test_expect_success 'a search ignores case' ' + cgit_ok_url "foo/log&qt=grep&q=COMMIT+1" >tmp && + test_grep ">commit 1<" tmp && + test_grep ! ">commit 2<" tmp +' + +# The commit below has a committer of its own, which an author search does +# not see. +test_expect_success 'a committer search matches the committer' ' + mkrepo repos/who 1 && + GIT_COMMITTER_NAME="Other Committer" git -C repos/who commit --allow-empty -m "by other" && + cgitrc_repo whorc who && + cgit_ok whorc "url=who/log/&qt=committer&q=other" >tmp && + test_grep ">by other<" tmp && + test_grep ! ">commit 1<" tmp && + cgit_ok whorc "url=who/log/&qt=author&q=other" >tmp && + test_grep "No commits match the search" tmp +' + # A search that matches nothing says so in a row of its own, rather than # leaving the table a header with nothing under it. test_expect_success 'a search matching nothing says so' ' -- cgit 2.12.1