gbranden pushed a commit to branch master
in repository groff.

commit 2531915cb5440fb50d38569102982d46e422bd6d
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Oct 8 05:37:19 2025 -0500

    [mandoc]: Regression-test useful line numbers.
    
    ...reported in diagnostics when continuously rendering.
    
    * tmac/tests/andoc_report-useful-line-numbers-in-diagnostics.sh: Add
      test.
    
    * tmac/tmac.am (tmac_TESTS): Run test.
---
 ChangeLog                                          | 10 +++
 ...oc_report-useful-line-numbers-in-diagnostics.sh | 79 ++++++++++++++++++++++
 tmac/tmac.am                                       |  1 +
 3 files changed, 90 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 860d981ec..a23b43e8f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2025-10-08  G. Branden Robinson <[email protected]>
+
+       [mandoc]: Regression-test useful output file line numbers
+       reported in diagnostics when continuously rendering and
+       switching macro packages.
+
+       * tmac/tests/andoc_report-useful-line-numbers-in-diagnostics.sh:
+       Add test.
+       * tmac/tmac.am (tmac_TESTS): Run test.
+
 2025-10-08  G. Branden Robinson <[email protected]>
 
        [man]: Regression-test useful output file line numbers reported
diff --git a/tmac/tests/andoc_report-useful-line-numbers-in-diagnostics.sh 
b/tmac/tests/andoc_report-useful-line-numbers-in-diagnostics.sh
new file mode 100755
index 000000000..9d69b53ec
--- /dev/null
+++ b/tmac/tests/andoc_report-useful-line-numbers-in-diagnostics.sh
@@ -0,0 +1,79 @@
+#!/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"
+
+fail=
+
+wail () {
+    echo "...FAILED" >&2
+    fail=YES
+}
+
+input1='.
+.TH foo 1 2025-10-08 "groff test suite"
+.SH Name
+foo \- frobnicate a bar
+.
+.Dd 2025-10-08
+.Dt bar 1
+.Os "groff test suite"
+.Sh Name
+.Nm bar
+.Nd barnicate a foo
+.Sh Description
+#############################################\
+#############################################
+.'
+
+error1=$(printf "%s\n" "$input1" \
+    | "$groff" -mandoc -T ascii -P -cbou -z 2>&1)
+output1=$(printf "%s\n" "$input1" \
+    | "$groff" -mandoc -T ascii -P -cbou 2> /dev/null)
+echo "$error1"
+echo "$output1"
+echo "$error1" | grep -Fq 'line 14' || wail
+
+input2='.
+.Dd 2025-10-08
+.Dt foo 1
+.Os "groff test suite"
+.Sh Name
+.Nm foo
+.Nd frobnicate a bar
+.
+.TH bar 1 2025-10-08 "groff test suite"
+.SH Name
+bar \- barnicate a foo
+.SH Description
+#############################################\
+#############################################
+.'
+
+error2=$(printf "%s\n" "$input2" \
+    | "$groff" -mandoc -T ascii -P -cbou -z 2>&1)
+output2=$(printf "%s\n" "$input2" \
+    | "$groff" -mandoc -T ascii -P -cbou 2> /dev/null)
+echo "$error2"
+echo "$output2"
+echo "$error2" | grep -Fq 'line 14' || wail
+
+test -z "$fail"
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 3871255de..dec9ecadf 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -193,6 +193,7 @@ tmac_TESTS = \
   tmac/tests/andoc_check-an-to-doc-transition.sh \
   tmac/tests/andoc_clear-doc-traps.sh \
   tmac/tests/andoc_flush-between-packages.sh \
+  tmac/tests/andoc_report-useful-line-numbers-in-diagnostics.sh \
   tmac/tests/doc-old_vertical-margins-are-correct.sh \
   tmac/tests/doc_CS-register-works.sh \
   tmac/tests/doc_CT-register-works.sh \

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

Reply via email to