[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 03/127: [andoc]: Improve test sensitivity.
From: |
G. Branden Robinson |
Subject: |
[groff] 03/127: [andoc]: Improve test sensitivity. |
Date: |
Mon, 10 Jul 2023 04:30:11 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 81b28de1c84218829600edafa1a98af659916dbe
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Mar 22 18:19:45 2023 -0500
[andoc]: Improve test sensitivity.
* tmac/tests/andoc_clear-doc-traps.sh: Do it.
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:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 03/127: [andoc]: Improve test sensitivity.,
G. Branden Robinson <=