From: Ian Jackson Date: Thu, 28 Jun 2018 14:46:06 +0000 (+0100) Subject: test suite: manpages-format: Prep for other formats (nfc) X-Git-Tag: archive/debian/5.6~5 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=9f89aa601dc0ca0ea4387ce3cd9e1304770577e3;hp=1066c6442bc1471d440ac86711250d825b5ddc2c test suite: manpages-format: Prep for other formats (nfc) Signed-off-by: Ian Jackson --- diff --git a/tests/tests/manpages-format b/tests/tests/manpages-format index 4b9585f2..79eda752 100755 --- a/tests/tests/manpages-format +++ b/tests/tests/manpages-format @@ -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