summaryrefslogtreecommitdiffstats
path: root/contrib/mm/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:44:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:44:05 +0000
commitd318611dd6f23fcfedd50e9b9e24620b102ba96a (patch)
tree8b9eef82ca40fdd5a8deeabf07572074c236095d /contrib/mm/tests
parentInitial commit. (diff)
downloadgroff-d318611dd6f23fcfedd50e9b9e24620b102ba96a.tar.xz
groff-d318611dd6f23fcfedd50e9b9e24620b102ba96a.zip
Adding upstream version 1.23.0.upstream/1.23.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'contrib/mm/tests')
-rwxr-xr-xcontrib/mm/tests/LT_SP_AU_without_AT_works.sh50
-rwxr-xr-xcontrib/mm/tests/LT_SP_multi-word_LO_SJ_works.sh49
-rwxr-xr-xcontrib/mm/tests/MT-1-reports-all-TM-numbers.sh53
-rwxr-xr-xcontrib/mm/tests/MT_5_includes_AT_in_SG.sh43
-rwxr-xr-xcontrib/mm/tests/P-indentation-works.sh135
-rw-r--r--contrib/mm/tests/artifacts/60657.ref11
-rwxr-xr-xcontrib/mm/tests/ms_cover_sheet_robust_to_missing_AF.sh39
-rwxr-xr-xcontrib/mm/tests/mse_has-sufficient-footnote-space.sh77
-rwxr-xr-xcontrib/mm/tests/place-equation-labels-correctly-in-displays.sh62
-rwxr-xr-xcontrib/mm/tests/remove-stale-bib-entry-data.sh72
-rwxr-xr-xcontrib/mm/tests/short-pages-do-not-overflow-stack.sh59
11 files changed, 650 insertions, 0 deletions
diff --git a/contrib/mm/tests/LT_SP_AU_without_AT_works.sh b/contrib/mm/tests/LT_SP_AU_without_AT_works.sh
new file mode 100755
index 0000000..7589966
--- /dev/null
+++ b/contrib/mm/tests/LT_SP_AU_without_AT_works.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# Copyright (C) 2021 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+# Regression-test Savannah #60373 (3/3).
+#
+# Ensure that an author name (AU) with no title (AT) isn't rendered with
+# a trailing comma.
+#
+# Thanks to Robert Goulding for the reproducer.
+
+EXAMPLE='.LT SP
+.WA "John Doe"
+Nowhere,
+USA.
+.WE
+.IA "Jane Smith"
+Somewhere,
+UK.
+.IE
+.LO SJ "Letter of Introduction"
+.LO SA "Dear Ms.\& Smith"
+.P
+This is the text of the letter.
+.FC "Yours sincerely,"
+.SG'
+
+echo "$EXAMPLE" \
+ | "$groff" -Tascii -P-cbou -mm \
+ | grep -Eqx '[[:space:]]+JOHN DOE[[:space:]]*'
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/contrib/mm/tests/LT_SP_multi-word_LO_SJ_works.sh b/contrib/mm/tests/LT_SP_multi-word_LO_SJ_works.sh
new file mode 100755
index 0000000..98c3fda
--- /dev/null
+++ b/contrib/mm/tests/LT_SP_multi-word_LO_SJ_works.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# Copyright (C) 2021 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+# Regression-test Savannah #60373 (1/3).
+#
+# Ensure that a multi-word subject line (LO SJ) gets rendered.
+#
+# Thanks to Robert Goulding for the reproducer.
+
+EXAMPLE='.LT SP
+.WA "John Doe"
+Nowhere,
+USA.
+.WE
+.IA "Jane Smith"
+Somewhere,
+UK.
+.IE
+.LO SJ "Letter of Introduction"
+.LO SA "Dear Ms.\& Smith"
+.P
+This is the text of the letter.
+.FC "Yours sincerely,"
+.SG'
+
+echo "$EXAMPLE" \
+ | "$groff" -Tascii -P-cbou -mm \
+ | grep -Eqx '[[:space:]]+LETTER OF INTRODUCTION[[:space:]]*'
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/contrib/mm/tests/MT-1-reports-all-TM-numbers.sh b/contrib/mm/tests/MT-1-reports-all-TM-numbers.sh
new file mode 100755
index 0000000..3224e7c
--- /dev/null
+++ b/contrib/mm/tests/MT-1-reports-all-TM-numbers.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# Copyright (C) 2023 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+fail=
+
+wail () {
+ echo ...FAILED >&2
+ fail=YES
+}
+
+# Regression-test Savannah #63613. The identifiers of all technical
+# memoranda should be formatted.
+
+input='.TL
+My Memo
+.AU "Random Hacker"
+.TM 23-SKIDOO 24-URTHRU
+.MT 1
+This is my memo.
+.
+There are many like it but this one is mine.'
+
+output=$(printf "%s\n" "$input" | "$groff" -mm -Tascii -P-cbou)
+echo "$output"
+
+echo "checking that first TM number is present" >&2
+echo "$output" | grep -q "23-SKIDOO" || wail
+
+echo "checking that second TM number is present" >&2
+echo "$output" | grep -q "24-URTHRU" || wail
+
+test -z "$fail"
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/contrib/mm/tests/MT_5_includes_AT_in_SG.sh b/contrib/mm/tests/MT_5_includes_AT_in_SG.sh
new file mode 100755
index 0000000..4f23d53
--- /dev/null
+++ b/contrib/mm/tests/MT_5_includes_AT_in_SG.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# Copyright (C) 2021 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+# Regression-test Savannah #57034.
+#
+# Ensure that an author's title (if any) is written in the signature.
+#
+# Thanks to Ken Mandelberg for the reproducer.
+
+EXAMPLE='.TL
+Inquiry
+.AU "John SMITH"
+.AT "Director"
+.MT 5
+.P
+sentence
+.FC Sincerely,
+.SG'
+
+echo "$EXAMPLE" \
+ | "$groff" -Tascii -P-cbou -mm \
+ | grep -Eqx '[[:space:]]+Director[[:space:]]*'
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/contrib/mm/tests/P-indentation-works.sh b/contrib/mm/tests/P-indentation-works.sh
new file mode 100755
index 0000000..5be7efd
--- /dev/null
+++ b/contrib/mm/tests/P-indentation-works.sh
@@ -0,0 +1,135 @@
+#!/bin/sh
+#
+# Copyright (C) 2023 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+fail=
+
+wail () {
+ echo ...FAILED >&2
+ fail=YES
+}
+
+# Regression-test Savannah #54909. Check other cases as well.
+
+input='.P
+P1 not indented.
+.P 0
+P2 not indented.
+.P 1
+P3 indented.
+.nr Pt 2
+.P
+P4 indented.
+.H 1 Heading
+.P
+P5 not indented.
+.P
+P6 indented.
+.H 3 "Run-in heading."
+Some text.
+.P
+P7 indented.
+.DS
+display
+.DE
+.P
+P8 not indented.
+.P
+P9 indented.
+.BL
+.LI
+list item
+.LE
+.P
+P10 not indented.
+.P
+P11 indented.'
+
+output=$(printf "%s\n" "$input" | "$groff" -mm -Tascii -P-cbou)
+echo "$output"
+
+# P1 not indented.
+#
+# P2 not indented.
+#
+# P3 indented.
+#
+# P4 indented.
+#
+#
+# 1. Heading
+#
+# P5 not indented.
+#
+# P6 indented.
+#
+# 1.0.1 Run-in heading. Some text.
+#
+# P7 indented.
+#
+# display
+#
+# P8 not indented.
+#
+# P9 indented.
+#
+# o list item
+#
+# P10 not indented.
+#
+# P11 indented.
+
+echo "checking that initial untyped paragraph not indented" >&2
+echo "$output" | grep -Eqx ' {7}P1 not indented\.' || wail
+
+echo "checking that initial type 0 paragraph not indented" >&2
+echo "$output" | grep -Eqx ' {7}P2 not indented\.' || wail
+
+echo "checking that first paragraph after Pt=2 indented" >&2
+echo "$output" | grep -Eqx ' {12}P3 indented\.' || wail
+
+echo "checking that second paragraph after Pt=2 indented" >&2
+echo "$output" | grep -Eqx ' {12}P4 indented\.' || wail
+
+echo "checking that first paragraph after heading not indented" >&2
+echo "$output" | grep -Eqx ' {7}P5 not indented\.' || wail
+
+echo "checking that second paragraph after heading indented" >&2
+echo "$output" | grep -Eqx ' {12}P6 indented\.' || wail
+
+echo "checking that paragraph after run-in heading indented" >&2
+echo "$output" | grep -Eqx ' {12}P7 indented\.' || wail
+
+echo "checking that first paragraph after display not indented" >&2
+echo "$output" | grep -Eqx ' {7}P8 not indented\.' || wail
+
+echo "checking that second paragraph after display indented" >&2
+echo "$output" | grep -Eqx ' {12}P9 indented\.' || wail
+
+echo "checking that first paragraph after list not indented" >&2
+echo "$output" | grep -Eqx ' {7}P10 not indented\.' || wail
+
+echo "checking that second paragraph after list indented" >&2
+echo "$output" | grep -Eqx ' {12}P11 indented\.' || wail
+
+test -z "$fail"
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/contrib/mm/tests/artifacts/60657.ref b/contrib/mm/tests/artifacts/60657.ref
new file mode 100644
index 0000000..ed7f6f3
--- /dev/null
+++ b/contrib/mm/tests/artifacts/60657.ref
@@ -0,0 +1,11 @@
+%K 1
+%A First Author
+%B First Book
+%O Test one
+
+%K 2
+%A Second Author
+%B Second Book
+
+%K 3
+%A Third Author
diff --git a/contrib/mm/tests/ms_cover_sheet_robust_to_missing_AF.sh b/contrib/mm/tests/ms_cover_sheet_robust_to_missing_AF.sh
new file mode 100755
index 0000000..66086f8
--- /dev/null
+++ b/contrib/mm/tests/ms_cover_sheet_robust_to_missing_AF.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Copyright (C) 2021 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+# Regression-test Savannah #60915.
+#
+# Ensure that a missing firm definition doesn't disrupt cover sheet
+# layout.
+
+EXAMPLE='.COVER
+.ND 2020-07-17
+.TL
+The Great American Novel
+.AU "Eileen M. Plausible"
+.COVEND'
+
+echo "$EXAMPLE" \
+ | "$groff" -Tascii -P-cbou -mm \
+ | grep -Fqx ' 2020-07-17' # 7 spaces
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/contrib/mm/tests/mse_has-sufficient-footnote-space.sh b/contrib/mm/tests/mse_has-sufficient-footnote-space.sh
new file mode 100755
index 0000000..936d9e5
--- /dev/null
+++ b/contrib/mm/tests/mse_has-sufficient-footnote-space.sh
@@ -0,0 +1,77 @@
+#!/bin/sh
+#
+# Copyright (C) 2022 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+# Regression-test Savnnah #63398.
+
+input='.de M
+. nr N \\\\$1-1
+. if \\\\$1 .M \\\\nN
+Sed ut perspiciatis, unde omnis iste natus error sit voluptatem
+accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab
+illo inventore veritatis et quasi architecto beatae vitae dicta sunt,
+explicabo.\\\\*F
+. FS
+footnote text
+. FE
+..
+.P
+.M 16'
+
+# .de M
+# . nr N \\$1-1
+# . if \\$1 .M \\nN
+# Sed ut perspiciatis, unde omnis iste natus error sit voluptatem
+# accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab
+# illo inventore veritatis et quasi architecto beatae vitae dicta sunt,
+# explicabo.\\*F
+# .FS
+# blather
+# .FE
+# Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur
+# aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione
+# voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum,
+# quia dolor sit amet consectetur adipiscivelit, sed quia non-numquam eius
+# modi tempora incidunt, ut labore et dolore magnam aliquam quaerat
+# voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam
+# corporis suscipitlaboriosam, nisi ut aliquid ex ea commodi consequatur?
+# Quis autem vel eum iure reprehenderit, qui inea voluptate velit esse,
+# quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo
+# voluptas nulla pariatur? At vero eos et accusamus et iusto odio
+# dignissimos ducimus, qui blanditiis praesentium voluptatum deleniti
+# atque corrupti, quos dolores et quas molestias excepturi sint, obcaecati
+# cupiditate non-provident, similique sunt in culpa, qui officia deserunt
+# mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum
+# facilis est et expedita distinctio. Nam libero tempore, cum soluta
+# nobis est eligendi optio, cumque nihil impedit, quo minus id, quod
+# maxime placeat, facere possimus, omnis voluptas assumenda est, omnis
+# dolor repellendus. Temporibus autem quibusdam et aut officiis debitis
+# aut rerum necessitatibus saepe eveniet, ut et voluptates repudiandae
+# sint et molestiae non-recusandae. Itaque earum rerum hic tenetur a
+# sapiente delectus, ut aut reiciendis voluptatibus maiores alias
+# consequatur aut perferendis doloribus asperiores repellat.
+# ..
+# .P
+# .M 4
+
+output=$(echo "$input" | "$groff" -mm -mmse -Tps)
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/contrib/mm/tests/place-equation-labels-correctly-in-displays.sh b/contrib/mm/tests/place-equation-labels-correctly-in-displays.sh
new file mode 100755
index 0000000..1970397
--- /dev/null
+++ b/contrib/mm/tests/place-equation-labels-correctly-in-displays.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+# Copyright (C) 2022 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+fail=
+
+wail () {
+ echo FAILED >&2
+ fail=YES
+}
+
+# Regression-test Savannah #62190. Check left- and center-aligned
+# displayed equations as well.
+
+input='.DS L
+.EQ (1)
+p = q
+.EN
+.DE
+.DS I
+.EQ (2)
+w = z
+.EN
+.DE
+.DS C
+.EQ (3)
+x = y
+.EN
+.DE'
+
+output=$(printf "%s\n" "$input" | "$groff" -e -mm -Tascii -P-cbou)
+
+echo "checking left-aligned displayed equation" >&2
+echo "$output" | grep -Eq 'p=q {54}\(1\)' || wail
+
+echo "checking indented displayed equation" >&2
+echo "$output" | grep -Eq 'w=z {49}\(2\)' || wail
+
+echo "checking centered displayed equation" >&2
+echo "$output" | grep -Eq 'x=y {26}\(3\)' || wail
+
+test -z "$fail" || exit 1
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/contrib/mm/tests/remove-stale-bib-entry-data.sh b/contrib/mm/tests/remove-stale-bib-entry-data.sh
new file mode 100755
index 0000000..5fb68e6
--- /dev/null
+++ b/contrib/mm/tests/remove-stale-bib-entry-data.sh
@@ -0,0 +1,72 @@
+#!/bin/sh
+#
+# Copyright (C) 2022 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+fail=
+
+wail () {
+ echo FAILED >&2
+ fail=YES
+}
+
+# Regression-test Savannah #60657. Ensure data from a bibliographic
+# entry don't carry over to the next.
+
+# Locate directory containing our test artifacts.
+artifact_dir=
+
+for buildroot in . .. ../..
+do
+ d=$buildroot/contrib/mm/tests/artifacts
+ if [ -d "$d" ]
+ then
+ artifact_dir=$d
+ break
+ fi
+done
+
+# If we can't find it, we can't test.
+test -z "$artifact_dir" && exit 77 # skip
+
+input=".R1
+bibliography $artifact_dir/60657.ref
+.R2"
+
+output=$(echo "$input" | "$groff" -R -mm -Tascii -P-cbou)
+
+echo "checking first entry"
+echo "$output" \
+ | grep -q "1\. First Author in First Book\. Test one\.$" \
+ || wail
+
+echo "checking second entry"
+echo "$output" \
+ | grep -q "2\. Second Author in Second Book\.$" \
+ || wail
+
+echo "checking third entry"
+echo "$output" \
+ | grep -q "3\. Third Author\.$" \
+ || wail
+
+test -z "$fail" || exit 1
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/contrib/mm/tests/short-pages-do-not-overflow-stack.sh b/contrib/mm/tests/short-pages-do-not-overflow-stack.sh
new file mode 100755
index 0000000..4be0e13
--- /dev/null
+++ b/contrib/mm/tests/short-pages-do-not-overflow-stack.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# Copyright (C) 2022 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+fail=
+
+wail () {
+ echo FAILED >&2
+ fail=YES
+}
+
+# Regression-test Savannah #24048. Pages that are too short to
+# accommodate minimal header and footer requirements should not cause
+# infinite trap recursion.
+
+input='.COVER
+.TL
+Title
+.AU "R. Thurston Howell"
+.AT "Professor of Agnotology" "Publisher, Posterior Analytics Weekly"
+.COVEND
+.P
+Main matter goes here.'
+
+echo "checking that sample document fits using default length" >&2
+output=$(printf "%s\n" "$input" \
+ | "$groff" -b -mm -Tascii -P-cbou) || wail
+
+echo "checking that sample document fits using -rL5v" >&2
+output=$(printf "%s\n" "$input" \
+ | "$groff" -b -rL5v -mm -Tascii -P-cbou) || wail
+
+echo "checking that sample document fails gracefully using -rL4v" >&2
+error=$(printf "%s\n" "$input" \
+ | "$groff" -b -rL4v -mm -Tascii -P-cbou -z 2>&1)
+# Assume that >= 10 lines of stderr must be due to a giant backtrace.
+test $(echo "$error" | wc -l) -lt 10 || wail
+
+test -z "$fail"
+
+# vim:set ai et sw=4 ts=4 tw=72: