From ee1910cb49244979a6639d92d92ef0753e4f1e43 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 30 Oct 2026 23:47:25 -0700 Subject: Check the filter flush on pages already fetched The about check already finds the div right before the filtered text, so its copy went, and the tree page is flattened where it was first read. --- tests/t0201-filters.sh | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/tests/t0201-filters.sh b/tests/t0201-filters.sh index af2f4fa..a642120 100755 --- a/tests/t0201-filters.sh +++ b/tests/t0201-filters.sh @@ -21,8 +21,14 @@ do cgit_url 'filter-$prefix/tree/a%2bb' >tmp " + # Page output is buffered and has to be flushed as stdout is handed + # to a filter and back. A missed flush reorders the page rather than + # losing any of it, so the test below watches which side of the + # filtered text the surrounding markup lands on. test_expect_success "check whether the $prefix source filter works" ' - grep "a+b HELLO$" tmp + grep "a+b HELLO$" tmp && + tr -d "\n" flat.out && + grep "a+b HELLO" flat.out ' test_expect_success "generate filter-$prefix/about/" " @@ -48,21 +54,6 @@ do test_expect_success "check whether the $prefix email filter works for committers" ' grep " commit C O MITTER <COMMITTER@EXAMPLE.COM>" tmp ' - - # Page output is buffered and has to be flushed as stdout is handed - # to a filter and back. A missed flush reorders the page rather than - # losing any of it, so the two tests below watch which side of the - # filtered text the surrounding markup lands on. - test_expect_success "the $prefix source filter output stays inside its cell" " - cgit_url 'filter-$prefix/tree/a%2bb' >tmp && - tr -d '\n' flat.out && - grep 'a+b HELLO' flat.out - " - - test_expect_success "the $prefix about filter output stays inside its div" " - cgit_url 'filter-$prefix/about/' >tmp && - grep \"
a+b /filter-$prefix/tree/ HELLO\" tmp - " done test_expect_success 'the blame page goes through the source filter too' ' -- cgit 2.12.1