Diff options
Diffstat (limited to 'tests/t0004-docs.sh')
-rwxr-xr-xtests/t0004-docs.sh17
1 file changed, 14 insertions, 3 deletions
diff --git a/tests/t0004-docs.sh b/tests/t0004-docs.sh
index 1eca51e..25ddcd6 100755
--- a/tests/t0004-docs.sh
+++ b/tests/t0004-docs.sh
@@ -2,9 +2,10 @@
# Checks that the configuration documents stay consistent with each other.
# The manual documents every key the reference config sets, the reference
-# config sets every key the manual documents, both settings sections of the
-# manual keep their entries sorted, and the three server configs carry one
-# identical content security policy.
+# config sets every key the manual documents and puts scan-path after every
+# global setting, both settings sections of the manual keep their entries
+# sorted, and the three server configs carry one identical content security
+# policy.
test_description='Check the configuration documents'
. ./setup.sh
@@ -33,6 +34,16 @@ test_expect_success 'every key the reference config sets is documented' '
test_must_be_empty undocumented
'
+# A scanned repository inherits the global settings above scan-path, so the
+# sample keeps none below it.
+test_expect_success 'the reference config scans after every global setting' '
+ sed -n "/^#\{0,1\}scan-path=/,\$p" "$ROOT/custom/cgitrc" |
+ sed -n "s/^#\{0,1\}\([a-z][a-zA-Z0-9.<>-]*\)=.*/\1/p" |
+ grep -v "^repo\." >after-scan-path &&
+ echo scan-path >expect &&
+ test_cmp expect after-scan-path
+'
+
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 &&