Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Check settings below scan-path miss the scan
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0004-docs.sh | 40 |
1 file changed, 37 insertions, 3 deletions
diff --git a/tests/t0004-docs.sh b/tests/t0004-docs.sh index 47ae0f5..b50c58c 100755 --- a/tests/t0004-docs.sh +++ b/tests/t0004-docs.sh @@ -3,9 +3,10 @@ # Checks that the configuration documents stay consistent with each other and # with cgit. The manual and the reference config name the same keys, and cgit # accepts every key the manual documents and no other. The reference config -# changes nothing as it ships and puts scan-path after every global setting. -# The manual's contents name its sections in order, and both settings -# sections keep their entries sorted. +# changes nothing as it ships and puts scan-path after every global setting, +# and two settings the manual wants prior to scan-path are shown to miss a +# scan above them. The manual's contents name its sections in order, and both +# settings sections keep their entries sorted. test_description='Check the configuration documents' CGIT_TEST_NO_CREATE_REPOS=YesPlease @@ -100,6 +101,39 @@ test_expect_success 'the reference config scans after every global setting' ' test_cmp expect after-scan-path ' +# The scan runs as its line is read, which is why the manual has these two +# defined prior to it. Below it, strict-export comes too late to filter and +# cache-size too late to keep the list, though the page is still cached. +test_expect_success 'strict-export and cache-size reach the scan only above it' ' + mkrepo scanned/exported 1 >/dev/null && + mkrepo scanned/plain 1 >/dev/null && + touch scanned/exported/.git/export-ok && + mkdir above below && + { + echo "virtual-root=/" && + echo "cache-root=$PWD/above" && + echo "strict-export=export-ok" && + echo "cache-size=64" && + echo "scan-path=$PWD/scanned" + } >aboverc && + { + echo "virtual-root=/" && + echo "cache-root=$PWD/below" && + echo "scan-path=$PWD/scanned" && + echo "strict-export=export-ok" && + echo "cache-size=64" + } >belowrc && + cgit_ok aboverc "url=" >tmp && + test_grep ">exported</a>" tmp && + test_grep ! ">plain</a>" tmp && + ls above/rc-* && + cgit_ok belowrc "url=" >tmp && + test_grep ">plain</a>" tmp && + ls below >slots && + test_line_count = 1 slots && + test_grep ! "^rc-" slots +' + test_expect_success 'the manual lists its global settings in order' ' sed -n "/^Global settings$/,/^Repository settings$/p" "$ROOT/MANUAL.txt" | sed -n "s/^\([a-z][a-zA-Z0-9.<>-]*\)::$/\1/p" >global-order && |
