diff options
Diffstat (limited to 'tests')
-rwxr-xr-xtests/t0201-filters.sh12
1 file changed, 12 insertions, 0 deletions
diff --git a/tests/t0201-filters.sh b/tests/t0201-filters.sh
index c6b23af..07db677 100755
--- a/tests/t0201-filters.sh
+++ b/tests/t0201-filters.sh
@@ -87,6 +87,18 @@ test_expect_success 'the site readme leaves the tree url empty' '
grep "root.txt SITE" tmp
'
+test_expect_success 'only a repository page hands filters its variables' '
+ write_script env.sh <<-\EOF &&
+ cat >/dev/null
+ echo "repo url: $CGIT_REPO_URL."
+ EOF
+ sed "s|^about-filter=.*|about-filter=exec:$PWD/env.sh|" aboutargsrc >envrc &&
+ CGIT_CONFIG="$PWD/envrc" QUERY_STRING="url=filtered/about/" cgit >tmp &&
+ grep "repo url: filtered\." tmp &&
+ CGIT_CONFIG="$PWD/envrc" QUERY_STRING="p=about" cgit >tmp &&
+ grep "repo url: \." tmp
+'
+
test "$CGIT_HAS_LUA" -eq 1 && test_set_prereq CGIT_LUA
test "$CGIT_HAS_LUA" -eq 1 || say 'cgit built without lua, error page check skipped'