From aec13bb653f26c097157c7cf7f795aa4e4644b86 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 11:46:50 -1000 Subject: Hold the log tests to a working page The log requests passed on any answer short of a crash. The search checks after the first read a page an earlier test wrote, so run alone they passed with no page at all, and three tests shared one title. The switcher checks found the right option selected but not that it was the only one, and a failed check left its tag behind for the tests after it. The broken walk's log was written and never read. --- tests/t0103-log.sh | 90 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 54 insertions(+), 36 deletions(-) (limited to 'tests/t0103-log.sh') diff --git a/tests/t0103-log.sh b/tests/t0103-log.sh index 444db8f..16fc6e9 100755 --- a/tests/t0103-log.sh +++ b/tests/t0103-log.sh @@ -7,52 +7,70 @@ test_description='Check content on log page' . ./setup.sh -test_expect_success 'generate foo/log' 'cgit_url "foo/log" >tmp' -test_expect_success 'find commit 1' 'grep "commit 1" tmp' -test_expect_success 'find commit 5' 'grep "commit 5" tmp' +test_expect_success 'the log lists the whole of a short history' ' + cgit_ok_url "foo/log" >tmp && + test_grep ">commit 1<" tmp && + test_grep ">commit 5<" tmp +' + +test_expect_success 'the first log page holds fifty commits' ' + cgit_ok_url "bar/log" >tmp && + test_grep ">commit 1<" tmp && + test_grep ">commit 50<" tmp +' -test_expect_success 'generate bar/log' 'cgit_url "bar/log" >tmp' -test_expect_success 'find commit 1' 'grep ">commit 1<" tmp' -test_expect_success 'find commit 50' 'grep "commit 50" tmp' +# Prints the options of the branch switcher that carry selected. +selected_options() { + sed -n "/