gbranden pushed a commit to branch master
in repository groff.

commit 5c5d71a33228c787a9e218aa3bdea22a9d017c06
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Oct 4 11:03:44 2025 -0500

    [mdoc]: Add sanity/regression test.
    
    Regression-test continuously rendered degenerate output; a sane quantity
    of output lines should be produced.
    
    * tmac/tests/doc_format-degenerate-input-sanely.sh: Add test.
    * tmac/tmac.am (tmac_TESTS): Run test.
---
 ChangeLog                                        |  8 +++++++
 tmac/tests/doc_format-degenerate-input-sanely.sh | 28 ++++++++++++++++++++++++
 tmac/tmac.am                                     |  1 +
 3 files changed, 37 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 0b55d40c7..57126e149 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,14 @@
        Thanks to Grisha Levit for report of problem with some pdf
        viewers.
 
+2025-10-04  G. Branden Robinson <[email protected]>
+
+       [mdoc]: Regression-test continuously rendered degenerate output;
+       a sane quantity of output lines should be produced.
+
+       * tmac/tests/doc_format-degenerate-input-sanely.sh: Add test.
+       * tmac/tmac.am (tmac_TESTS): Run test.
+
 2025-10-04  G. Branden Robinson <[email protected]>
 
        [man]: Handle degenerate documents more robustly; if given
diff --git a/tmac/tests/doc_format-degenerate-input-sanely.sh 
b/tmac/tests/doc_format-degenerate-input-sanely.sh
new file mode 100755
index 000000000..f80b8554f
--- /dev/null
+++ b/tmac/tests/doc_format-degenerate-input-sanely.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Copyright 2025 G. Branden Robinson
+#
+# 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"
+
+# Command substitution in the shell removes an arbitrarily long sequence
+# of trailing newlines; prevent this by suffixing the output.
+output=$(echo degenerate | "$groff" -mdoc -T ascii -P -cbou; echo STOP)
+echo "$output"
+test $(echo "$output" | wc -l) -eq $(( 3 + 1 )) # plus the "STOP"
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index f3017c40c..a09a82498 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -210,6 +210,7 @@ tmac_TESTS = \
   tmac/tests/doc_degenerate-input-uses-sane-page-length.sh \
   tmac/tests/doc_do-not-hyphenate-hyperlink-with-no-link-text.sh \
   tmac/tests/doc_do-not-loop-infinitely-when-shortening-headers.sh \
+  tmac/tests/doc_format-degenerate-input-sanely.sh \
   tmac/tests/doc_heading-font-remapping-works.sh \
   tmac/tests/doc_hyphenation-mode-restoration-works.sh \
   tmac/tests/doc_indents-correctly.sh \

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to