gbranden pushed a commit to branch master
in repository groff.

commit f6e0acd5ebac909eb771acec6f0b649cf12d7f46
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Jan 13 09:59:25 2026 -0600

    [mm]: Regression-test for Savannah #67903.
    
    Indentation of the caption strings produced by the `TC` macro is
    erratic.
    
    * contrib/mm/tests/toc-captions-ident-correctly.sh: Do it.
    
    * contrib/mm/mm.am (mm_TESTS): Run test.
    
    Test fails at this commit.
---
 contrib/mm/ChangeLog                             |  8 +++
 contrib/mm/mm.am                                 |  1 +
 contrib/mm/tests/toc-captions-ident-correctly.sh | 75 ++++++++++++++++++++++++
 3 files changed, 84 insertions(+)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 6550a0fe5..83d719f74 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,11 @@
+2026-01-13  G. Branden Robinson <[email protected]>
+
+       Regression-test for Savannah #67903.  Indentation of the caption
+       strings produced by the `TC` macro is erratic.
+
+       * tests/toc-captions-ident-correctly.sh: Do it.
+       * mm.am (mm_TESTS): Run test.
+
 2026-01-11  G. Branden Robinson <[email protected]>
 
        * m.tmac: (LT): Define `@cover` string as `\\$0`, not "LT"
diff --git a/contrib/mm/mm.am b/contrib/mm/mm.am
index 467fb45c0..8992b8073 100644
--- a/contrib/mm/mm.am
+++ b/contrib/mm/mm.am
@@ -94,6 +94,7 @@ mm_TESTS = \
   contrib/mm/tests/place-equation-labels-correctly-in-displays.sh \
   contrib/mm/tests/remove-stale-bib-entry-data.sh \
   contrib/mm/tests/short-pages-do-not-overflow-stack.sh \
+  contrib/mm/tests/toc-captions-ident-correctly.sh \
   contrib/mm/tests/vertical-margins-are-correct.sh
 TESTS += $(mm_TESTS)
 EXTRA_DIST += \
diff --git a/contrib/mm/tests/toc-captions-ident-correctly.sh 
b/contrib/mm/tests/toc-captions-ident-correctly.sh
new file mode 100755
index 000000000..17656c108
--- /dev/null
+++ b/contrib/mm/tests/toc-captions-ident-correctly.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# Copyright 2026 G. Branden Robinson
+#
+# This file is part of groff, the GNU roff typesetting system.
+#
+# 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 #67903.  Input adapted from a minimal
+# reproducer by Alexis Hildebrant.
+
+input='.
+.nr Le 1 \" enable equation list in TOC
+.ds Rule \l#\\n[.l]u-1n#
+.ds Captc A\*[Rule]
+.ds Le B\*[Rule]
+.ds Lf C\*[Rule]
+.ds Lt D\*[Rule]
+.ds Lx E\*[Rule]
+.
+.ND 2026-01-11
+.TL
+It Beats a PowerPoint Deck
+.AU "W.\& G.\& Snuffy"
+.MT
+.H 1 "Section heading"
+.EC "My equation"
+.EX "My exhibit"
+.FG "My figure"
+.TB "My table"
+.TC
+.'
+
+output=$(printf '%s\n' "$input" | "$groff" -rO0 -mm -T ascii -P -cbou \
+    | sed '/^$/d')
+echo "$output"
+
+echo "checking indentation of 'Captc' string" >&2
+echo "$output" | grep -q '^A___' || wail
+
+echo "checking indentation of 'Lf' string" >&2
+echo "$output" | grep -q '^C___' || wail
+
+echo "checking indentation of 'Lt' string" >&2
+echo "$output" | grep -q '^D___' || wail
+
+echo "checking indentation of 'Le' string" >&2
+echo "$output" | grep -q '^B___' || wail
+
+echo "checking indentation of 'Lx' string" >&2
+echo "$output" | grep -q '^E___' || wail
+
+test -z "$fail"
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:

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

Reply via email to