From 89112ba472e201f10a87d42dda16be2a8071aca6 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 14:15:29 -0700 Subject: Check the filter flush on the 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(-) (limited to 'tests/t0201-filters.sh') 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