From 9f89aa601dc0ca0ea4387ce3cd9e1304770577e3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 28 Jun 2018 15:46:06 +0100 Subject: test suite: manpages-format: Prep for other formats (nfc) Signed-off-by: Ian Jackson --- tests/tests/manpages-format | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/tests/manpages-format b/tests/tests/manpages-format index 4b9585f..79eda75 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 -- cgit v1.2.3