gbranden pushed a commit to branch master
in repository groff.
commit 2ffd20b3cfaeddc4a60ee681370d76a3cafe0e52
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Oct 8 03:43:16 2025 -0500
[man]: Regression-test useful line numbers.
...reported in diagnostics when continuously rendering.
* tmac/tests/an_report-useful-line-numbers-in-diagnostics.sh: Add test.
* tmac/tmac.am (tmac_TESTS): Run test.
---
ChangeLog | 9 +++++
...an_report-useful-line-numbers-in-diagnostics.sh | 42 ++++++++++++++++++++++
tmac/tmac.am | 1 +
3 files changed, 52 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 63db5c43c..860d981ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-10-08 G. Branden Robinson <[email protected]>
+
+ [man]: Regression-test useful output file line numbers reported
+ in diagnostics when continuously rendering.
+
+ * tmac/tests/an_report-useful-line-numbers-in-diagnostics.sh:
+ Add test.
+ * tmac/tmac.am (tmac_TESTS): Run test.
+
2025-10-08 G. Branden Robinson <[email protected]>
* tmac/mdoc/doc-common (doc-end-document): Fix syntax/logic
diff --git a/tmac/tests/an_report-useful-line-numbers-in-diagnostics.sh
b/tmac/tests/an_report-useful-line-numbers-in-diagnostics.sh
new file mode 100755
index 000000000..651924fdd
--- /dev/null
+++ b/tmac/tests/an_report-useful-line-numbers-in-diagnostics.sh
@@ -0,0 +1,42 @@
+#!/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"
+
+input='.
+.TH foo 1 2025-10-08 "groff test suite"
+.SH Name
+foo \- frobnicate a bar
+.TH bar 1 2025-10-08 "groff test suite"
+.SH Name
+bar \- barnicate a foo
+.SH Description
+#############################################\
+#############################################
+.'
+
+error=$(printf "%s\n" "$input" \
+ | "$groff" -man -T ascii -P -cbou -z 2>&1)
+output=$(printf "%s\n" "$input" \
+ | "$groff" -man -T ascii -P -cbou 2> /dev/null)
+echo "$error"
+echo "$output"
+echo "$error" | grep -Fq 'line 14'
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 7abdb3b0f..3871255de 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -183,6 +183,7 @@ tmac_TESTS = \
tmac/tests/an_page-header-has-current-data.sh \
tmac/tests/an_paragraph-reset-preserves-line-length.sh \
tmac/tests/an_paragraph-reset-restores-hyphenation-mode.sh \
+ tmac/tests/an_report-useful-line-numbers-in-diagnostics.sh \
tmac/tests/an_reset-hyphenation-correctly.sh \
tmac/tests/an_title-abbreviation-works.sh \
tmac/tests/an_use-input-traps-correctly.sh \
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit