gbranden pushed a commit to branch branden-2023-03-31 in repository groff. commit 6f6615f151a28d11932ed0134797508c8a3f2b66 Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Wed Mar 22 18:19:45 2023 -0500
[andoc]: Improve test sensitivity. Also migrate to more recent test conventions, emitting the formatted output and updating the style of shell usage. --- tmac/tests/andoc_clear-doc-traps.sh | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/tmac/tests/andoc_clear-doc-traps.sh b/tmac/tests/andoc_clear-doc-traps.sh index 9a754e631..ef0e8a579 100755 --- a/tmac/tests/andoc_clear-doc-traps.sh +++ b/tmac/tests/andoc_clear-doc-traps.sh @@ -20,13 +20,22 @@ groff="${abs_top_builddir:-.}/test-groff" +fail= + +wail () { + echo ...FAILED >&2 + fail=YES +} + # Regression-test Savannah #59246. # # andoc should remove mdoc(7) traps before rendering a man(7) page. # Continuous rendering has to be _off_ to catch this. +# +# We also deliberately omit a fourth argument to the man(7) TH call to +# sniff out a stale footer component from mdoc(7). -EXAMPLE=\ -'.Dd October 11, 2020 +input='.Dd October 11, 2020 .Dt mdoc\-test 7 .Os .Sh Name @@ -34,14 +43,22 @@ EXAMPLE=\ .Nd lay mine .Sh Description Just testing. -.TH man\-test 7 2020-10-11 +.TH man\-test 7 2020-10-12 .SH Name man-test \- drive sheep across minefield .SH Description \[lq]doc\-footer\[rq] should definitely not be sprung by this document.' -! printf "%s\n" "$EXAMPLE" \ - | "$groff" -Tascii -P-cbou -mandoc -rcR=0 \ - | grep -E '^BSD +October 11, 2020 +3$' +output=$(printf "%s\n" "$input" \ + | "$groff" -Tascii -P-cbou -rC1 -rcR=0 -mandoc) +echo "$output" + +echo 'checking for correct mdoc(7) footer on first document' >&2 +echo "$output" | grep -Eqx 'GNU +October 11, 2020 +1' || wail + +echo 'checking for correct man(7) footer on second document' >&2 +echo "$output" | grep -Eqx ' +2020-10-12 +2' || wail + +test -z "$fail" # vim:set ai et sw=4 ts=4 tw=72: _______________________________________________ Groff-commit mailing list Groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit