gbranden pushed a commit to branch master
in repository groff.
commit 4206d68ba712dd132321d3194ddff7a1356d06d4
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Aug 3 03:23:26 2025 -0500
[mm]: Unit-test `LB` macro's `mark-format` arg.
* contrib/mm/tests/LB-mark-format-works.sh: Unit-test handling of `LB`
macro's `mark-format` argument.
* contrib/mm/mm.am (mm_TESTS): Run test.
Test fails at this commit.
---
contrib/mm/ChangeLog | 6 +++
contrib/mm/mm.am | 1 +
contrib/mm/tests/LB-mark-format-works.sh | 85 ++++++++++++++++++++++++++++++++
3 files changed, 92 insertions(+)
diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index d22c0868d..c2a211364 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,9 @@
+2025-08-03 G. Branden Robinson <[email protected]>
+
+ * tests/LB-mark-format-works.sh: Unit-test handling of `LB`
+ macro's `mark-format` argument.
+ * mm.am (mm_TESTS): Run test.
+
2025-08-03 G. Branden Robinson <[email protected]>
* m.tmac (debug@little-dump, debug@big-dump, S): In debugging
diff --git a/contrib/mm/mm.am b/contrib/mm/mm.am
index d17f5be59..c1f68e713 100644
--- a/contrib/mm/mm.am
+++ b/contrib/mm/mm.am
@@ -66,6 +66,7 @@ EXTRA_DIST += \
contrib/mm/mmroff.pl
mm_TESTS = \
+ contrib/mm/tests/LB-mark-format-works.sh \
contrib/mm/tests/LT-BL-spaces-before-date.sh \
contrib/mm/tests/LT-SP-AU-without-AT-works.sh \
contrib/mm/tests/LT-SP-multi-word-LO-SJ-works.sh \
diff --git a/contrib/mm/tests/LB-mark-format-works.sh
b/contrib/mm/tests/LB-mark-format-works.sh
new file mode 100755
index 000000000..60578dace
--- /dev/null
+++ b/contrib/mm/tests/LB-mark-format-works.sh
@@ -0,0 +1,85 @@
+#!/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"
+
+fail=
+
+wail () {
+ echo ...FAILED >&2
+ fail=YES
+}
+
+# Unit-test LB macro mark-format argument.
+
+input='.
+.P
+This is an
+.I mm
+document.
+.LB 4n 0 1 1 a 0 1
+.LI
+alpha
+.LE
+.LB 4n 0 1 1 A 0 1
+.LI
+bravo
+.LE
+.LB 4n 0 1 1 i 0 1
+.LI
+charlie
+.LE
+.LB 4n 0 1 1 I 0 1
+.LI
+delta
+.LE
+.LB 4n 0 1 1 0 0 1
+.LI
+echo
+.LE
+.LB 4n 0 1 1 99 0 1
+.LI
+foxtrot
+.LE
+.'
+
+output=$(echo "$input" | "$groff" -mm -Tascii -P-cbou)
+echo "$output"
+
+echo "checking rendering of 'a' format" >&2
+echo "$output" | grep -Fq 'a. alpha' || wail
+
+echo "checking rendering of 'A' format" >&2
+echo "$output" | grep -Fq 'A. bravo' || wail
+
+echo "checking rendering of 'i' format" >&2
+echo "$output" | grep -Fq 'i. charlie' || wail
+
+echo "checking rendering of 'I' format" >&2
+echo "$output" | grep -Fq 'I. delta' || wail
+
+echo "checking rendering of '0' format" >&2
+echo "$output" | grep -Fq '1. echo' || wail
+
+echo "checking rendering of '99' format" >&2
+echo "$output" | grep -Fq '01. foxtrot' || wail
+
+test -z "$fail"
+
+# vim:set ai et sw=4 ts=4 tw=72:
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit