Diff options
| -rwxr-xr-x | tests/t0201-filters.sh | 29 |
1 file changed, 13 insertions, 16 deletions
diff --git a/tests/t0201-filters.sh b/tests/t0201-filters.sh index 1f137b8..f9f1316 100755 --- a/tests/t0201-filters.sh +++ b/tests/t0201-filters.sh @@ -4,20 +4,17 @@ # page content to an outside program before it is written out. The checks in # the loop run once per kind of filter, the exec kind always and the lua kind # only where cgit was built with lua, because both have to produce the same -# page from the same repository. +# page from the same repository. Elsewhere the lua kind shows as skipped. test_description='Check filtered content' . ./setup.sh -prefixes="exec" -if test "$CGIT_HAS_LUA" -eq 1 -then - prefixes="$prefixes lua" -fi - -for prefix in $prefixes +for prefix in exec lua do - test_expect_success "generate filter-$prefix/tree/a%2bb" " + filter_prereq= + test "$prefix" = exec || filter_prereq=CGIT_LUA + + test_expect_success $filter_prereq "generate filter-$prefix/tree/a%2bb" " cgit_url 'filter-$prefix/tree/a%2bb' >tmp " @@ -25,33 +22,33 @@ do # 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" ' + test_expect_success $filter_prereq "check whether the $prefix source filter works" ' 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/" " + test_expect_success $filter_prereq "generate filter-$prefix/about/" " cgit_url 'filter-$prefix/about/' >tmp " - test_expect_success "check whether the $prefix about filter works" ' + test_expect_success $filter_prereq "check whether the $prefix about filter works" ' grep "<div id='"'"'about'"'"'>a+b /filter-$prefix/tree/ HELLO$" tmp ' - test_expect_success "generate filter-$prefix/commit/" " + test_expect_success $filter_prereq "generate filter-$prefix/commit/" " cgit_url 'filter-$prefix/commit/' >tmp " - test_expect_success "check whether the $prefix commit filter works" ' + test_expect_success $filter_prereq "check whether the $prefix commit filter works" ' grep "<div class='"'"'commit-subject'"'"'>ADD A+B" tmp ' - test_expect_success "check whether the $prefix email filter works for authors" ' + test_expect_success $filter_prereq "check whether the $prefix email filter works for authors" ' grep "<author@example.com> commit A U THOR <AUTHOR@EXAMPLE.COM>" tmp ' - test_expect_success "check whether the $prefix email filter works for committers" ' + test_expect_success $filter_prereq "check whether the $prefix email filter works for committers" ' grep "<committer@example.com> commit C O MITTER <COMMITTER@EXAMPLE.COM>" tmp ' done |
