chiark / gitweb /
test suite: manpages-format: Prep for other formats (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 28 Jun 2018 14:46:06 +0000 (15:46 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 Jun 2018 22:25:45 +0000 (23:25 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/tests/manpages-format

index 4b9585f..79eda75 100755 (executable)
@@ -23,11 +23,13 @@ run_man () {
 }
 
 for roff in $manpages; do
-       >$tmp/$roff.expected
+       for fmt in txt; do
+               >$tmp/$roff.$fmt-expected
+       done
 done
 
 expected () {
-       cat >$tmp/$1.expected
+       cat >$tmp/$2.$1-expected
 }
 
 not_egrep_vxPf () {
@@ -44,18 +46,27 @@ not_egrep_vxPf () {
        ' "$@"
 }
 
-expected dgit.1 <<'END'
+expected txt dgit.1 <<'END'
 .* # table wider than line width
 END
 
+prep () {
+       fmt=$1
+       errs=$tmp/$roff.$fmt-errs
+}
+
+check () {
+       perl -0777 -i~ -pe 's/\n[ \t]+/ # /' $errs
+       not_egrep_vxPf $tmp/$roff.$fmt-expected $errs
+}
+
 for roff in $manpages; do
        section=${roff##*.}
        page=${roff%.*}
 
-       errs=$tmp/$roff.errs
+       prep txt
        run_man >/dev/null
-       perl -0777 -i~ -pe 's/\n[ \t]+/ # /' $errs
-       not_egrep_vxPf $tmp/$roff.expected $errs
+       check
 done
 
 t-ok