gbranden pushed a commit to branch master
in repository groff.
commit 45e2586a30c7833b2d0f622f784de3f033268c60
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Jul 23 23:32:39 2025 -0500
[man]: Add test.
Guard against regression in planned refactoring.
* tmac/tests/an_paragraph-reset-preserves-line-length.sh: Add test.
* tmac/tmac.am (tmac_TESTS): Run it.
---
ChangeLog | 6 ++
.../an_paragraph-reset-preserves-line-length.sh | 96 ++++++++++++++++++++++
tmac/tmac.am | 1 +
3 files changed, 103 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index f881f4bbb..93476b751 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-07-23 G. Branden Robinson <[email protected]>
+
+ * tmac/tests/an_paragraph-reset-preserves-line-length.sh: Add
+ test.
+ * tmac/tmac.am (tmac_TESTS): Run it.
+
2025-07-20 G. Branden Robinson <[email protected]>
* tmac/an.tmac (TH): Rationalize; organize register and string
diff --git a/tmac/tests/an_paragraph-reset-preserves-line-length.sh
b/tmac/tests/an_paragraph-reset-preserves-line-length.sh
new file mode 100755
index 000000000..38d388809
--- /dev/null
+++ b/tmac/tests/an_paragraph-reset-preserves-line-length.sh
@@ -0,0 +1,96 @@
+#!/bin/sh
+#
+# Copyright (C) 2025 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"
+
+input='.
+'"'"'\" t
+.TH foo 1 "2025-07-23" "groff test suite"
+.SH Name
+foo \- frobnicate a bar
+.SH Description
+Here is a table.
+.IP
+.TS
+tab(@);
+Lf(BI) Lb
+L Lx.
+option@Effect
+AT@T{
+Attention;
+put contents of string
+.B LetAT
+and
+.I value
+left-aligned after the inside address.
+T}
+CN@T{
+Confidential;
+put
+.I value,
+or contents of string
+.BR LetCN ,
+left-aligned after the date.
+T}
+RN@T{
+Reference;
+put contents of string
+.B LetRN
+and
+.I value
+after the confidential notation
+(if any)
+and the date,
+aligned with the latter.
+T}
+SA@T{
+Salutation;
+put
+.I value,
+or contents of string
+.BR LetSA ,
+left-aligned after the inside address
+and the confidential notation
+(if any).
+T}
+SJ@T{
+Subject;
+put contents of string
+.B LetSJ
+and
+.I value
+left-aligned after the inside address
+and the attention and salutation notations
+(if any).
+.
+In letter type \[lq]SP\[rq],
+.B LetSJ
+is ignored and
+.I value
+is set in full capitals.
+T}
+.TE
+.'
+
+output=$(printf "%s\n" "$input" | "$groff" -t -man -Tascii -P -cbou)
+echo "$output"
+echo "$output" \
+ | grep -Eq 'confidential notation \(if any\) and the date, +aligned +with$'
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index e5d3da8b4..80c18ae26 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -172,6 +172,7 @@ tmac_TESTS = \
tmac/tests/an_output-footer-when-continuously-rendering.sh \
tmac/tests/an_page-footers-present.sh \
tmac/tests/an_page-header-has-current-data.sh \
+ tmac/tests/an_paragraph-reset-preserves-line-length.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