Diff options
| -rwxr-xr-x | tests/t0201-filters.sh | 16 |
1 file changed, 16 insertions, 0 deletions
diff --git a/tests/t0201-filters.sh b/tests/t0201-filters.sh index d928dec..2c68921 100755 --- a/tests/t0201-filters.sh +++ b/tests/t0201-filters.sh @@ -108,6 +108,22 @@ test_expect_success 'a filter killed by a signal ends the request' ' test_grep -F "Subprocess $PWD/killed-filter exited abnormally" err ' +test_expect_success 'a filter command with no prefix runs as exec' ' + cgitrc_repo bareprefixrc foo "repo.commit-filter=$FILTER_DIRECTORY/dump.sh" && + cgit_ok bareprefixrc "url=foo/commit/" >tmp && + test_grep "<div class=.commit-subject.>COMMIT 5" tmp +' + +# A prefix that names no kind of filter ends the request rather than leave +# the page unfiltered. +test_expect_success 'a filter command with an unknown prefix ends the request' ' + cgitrc_repo badprefixrc foo "repo.commit-filter=perl:$FILTER_DIRECTORY/dump.sh" && + cgit_rc badprefixrc "url=foo/commit/" >tmp 2>err && + test $(grep -c "^Status:" tmp) = 1 && + test_grep "^Status: 500" tmp && + test_grep -F "Invalid filter type: perl" err +' + # A die inside a lua filter has to reach the visitor as an error page rather # than being fed back into the filter that just failed, and the reason goes to # the log. |
