Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Make the main cgitrc filter check run the filter
The check asked for the summary page, which never runs an about filter, so it passed with exec:/bin/true on macOS, which has no such file, and with a filter that does not exist at all. Its first line read the stderr the previous test left behind. execvp searches the PATH, so a plain true runs the same on macOS, Debian and busybox.
Diffstat (limited to 'tests/t0205-config.sh')
-rwxr-xr-xtests/t0205-config.sh9
1 file changed, 6 insertions, 3 deletions
diff --git a/tests/t0205-config.sh b/tests/t0205-config.sh
index 4536e49..775e509 100755
--- a/tests/t0205-config.sh
+++ b/tests/t0205-config.sh
@@ -25,7 +25,8 @@ test_expect_success 'set up configs' '
echo "repo.desc=early" &&
echo "repo.url=diag" &&
echo "repo.path=$PWD/repos/foo/.git" &&
- echo "repo.about-filter=exec:/bin/true"
+ echo "repo.readme=:file-1" &&
+ echo "repo.about-filter=exec:true"
} >earlyrc
'
@@ -65,9 +66,11 @@ test_expect_success 'the flag lets a scanned repository set its filters' '
! grep "Ignoring" err
'
+# The filter prints nothing, so an empty about div shows that it ran in place
+# of the readme.
test_expect_success 'a repo filter in the main cgitrc needs no flag' '
- ! grep "about-filter" err &&
- CGIT_CONFIG="$PWD/earlyrc" QUERY_STRING="url=diag/" cgit >tmp 2>err &&
+ CGIT_CONFIG="$PWD/earlyrc" QUERY_STRING="url=diag/about/" cgit >tmp 2>err &&
+ grep "<div id=.about.></div>" tmp &&
! grep "about-filter" err
'