Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Drain the about filter in the config tests
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0205-config.sh | 8 |
1 file changed, 6 insertions, 2 deletions
diff --git a/tests/t0205-config.sh b/tests/t0205-config.sh index f13b2ec..32c260e 100755 --- a/tests/t0205-config.sh +++ b/tests/t0205-config.sh @@ -6,6 +6,9 @@ test_description='Check configuration diagnostics' . ./setup.sh test_expect_success 'set up configs' ' + write_script drain-filter <<-\EOF && + cat >/dev/null + EOF cgitrc_repo diagrc diag no-such-key=1 "repo.path=$PWD/repos/foo/.git" repo.no-such-repo-key=1 && { echo "virtual-root=/" && @@ -14,7 +17,7 @@ test_expect_success 'set up configs' ' echo "repo.url=diag" && echo "repo.path=$PWD/repos/foo/.git" && echo "repo.readme=:file-1" && - echo "repo.about-filter=exec:true" + echo "repo.about-filter=exec:$PWD/drain-filter" } >earlyrc ' @@ -55,7 +58,8 @@ test_expect_success 'the flag lets a scanned repository set its filters' ' ' # The filter prints nothing, so an empty about div shows that it ran in place -# of the readme. +# of the readme. It reads its input first, so its exit cannot race cgit's +# write. test_expect_success 'a repo filter in the main cgitrc needs no flag' ' cgit_rc earlyrc "url=diag/about/" >tmp 2>err && grep "<div id=.about.></div>" tmp && |
