Diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | 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 "<code>a+b HELLO$" tmp + grep "<code>a+b HELLO$" tmp && + tr -d "\n" <tmp >flat.out && + grep "<code>a+b HELLO</code>" 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 "<committer@example.com> 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' <tmp >flat.out && - grep '<code>a+b HELLO</code>' flat.out - " - - test_expect_success "the $prefix about filter output stays inside its div" " - cgit_url 'filter-$prefix/about/' >tmp && - grep \"<div id='about'>a+b /filter-$prefix/tree/ HELLO\" tmp - " done test_expect_success 'the blame page goes through the source filter too' ' |
