Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Check the manual's contents against its sections
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0004-docs.sh | 13 |
1 file changed, 12 insertions, 1 deletion
diff --git a/tests/t0004-docs.sh b/tests/t0004-docs.sh index 4d94ad7..47ae0f5 100755 --- a/tests/t0004-docs.sh +++ b/tests/t0004-docs.sh @@ -4,7 +4,8 @@ # 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. -# Both settings sections of the manual keep their entries sorted. +# 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 @@ -111,4 +112,14 @@ test_expect_success 'the manual lists its repository settings in order' ' sort -c repo-order ' +# A section heading is the line above a row of dashes, and the contents list +# names every section but its own. +test_expect_success 'the contents of the manual name its sections in order' ' + sed -n "/^Contents$/,/^[^-]/s/^- //p" "$ROOT/MANUAL.txt" >contents && + test -s contents && + sed -n "\$!N;/\n--*\$/P;D" "$ROOT/MANUAL.txt" | + grep -v "^Contents$" >sections && + test_cmp sections contents +' + test_done |
