gbranden pushed a commit to branch master
in repository groff.

commit 6aee9660b9bac6305e787deb02a260afa4f84dbf
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Mar 31 19:06:19 2026 -0500

    [mm]: Regression-test Savannah #68201.
    
    Add regression test for Savannah #68201.  The `IA` and `WA` macros
    disable the escape character (and `IE` and `WE` reënable it).  This
    however is not compatible with DWB 3.3 mm, and makes support of these
    macros in non-English locales needlessly difficult.
    
    * contrib/mm/tests/IA-IE-WA-WE-allow-escape-sequences.sh: Do it.
    * contrib/mm/mm.am (mm_TESTS): Run test.
    
    Test fails at this commit.
---
 contrib/mm/ChangeLog                               | 11 +++
 contrib/mm/mm.am                                   |  1 +
 .../mm/tests/IA-IE-WA-WE-allow-escape-sequences.sh | 84 ++++++++++++++++++++++
 3 files changed, 96 insertions(+)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 111b918e7..dc83c4cf6 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,14 @@
+2026-03-31  G. Branden Robinson <[email protected]>
+
+       Add regression test for Savannah #68201.  The `IA` and `WA`
+       macros disable the escape character (and `IE` and `WE` re�nable
+       it).  This however is not compatible with DWB 3.3 mm, and makes
+       support of these macros in non-English locales needlessly
+       difficult.
+
+       * tests/IA-IE-WA-WE-allow-escape-sequences.sh: Do it.
+       * mm.am (mm_TESTS): Run test.
+
 2026-02-19  G. Branden Robinson <[email protected]>
 
        * tests/LB-mark-format-works.sh: Rename this...
diff --git a/contrib/mm/mm.am b/contrib/mm/mm.am
index 0a201cf1a..98181edb6 100644
--- a/contrib/mm/mm.am
+++ b/contrib/mm/mm.am
@@ -67,6 +67,7 @@ EXTRA_DIST += \
 
 mm_TESTS = \
   contrib/mm/tests/Captc-string-translates.sh \
+  contrib/mm/tests/IA-IE-WA-WE-allow-escape-sequences.sh \
   contrib/mm/tests/LB-mark-or-format-argument-works.sh \
   contrib/mm/tests/LT-BL-spaces-before-date.sh \
   contrib/mm/tests/LT-SP-AU-without-AT-works.sh \
diff --git a/contrib/mm/tests/IA-IE-WA-WE-allow-escape-sequences.sh 
b/contrib/mm/tests/IA-IE-WA-WE-allow-escape-sequences.sh
new file mode 100755
index 000000000..83b5df007
--- /dev/null
+++ b/contrib/mm/tests/IA-IE-WA-WE-allow-escape-sequences.sh
@@ -0,0 +1,84 @@
+#!/bin/sh
+#
+# Copyright 2026 G. Branden Robinson
+#
+# This file is part of mm, a reimplementation of the Documenter's
+# Workbench (DWB) troff memorandum macro package for use with GNU troff.
+#
+# 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 #68201.
+
+input='.
+.nr Hy 1
+.WA
+Louis C. «Wheezy» Gaspé-Fourier
+Legrande Schème de Québec S.A.
+Boîte 1234
+2900, boul. Édouard-Montpetit
+Montréal QC H3Z QJ4
+CANADA
+.WE
+.ND "31 Mars 2026"
+.IA
+Chuck Montesquieu, fils
+1789 Rue Condé
+New Orleans, LA  70116
+UNITED STATES
+.IE
+.LT
+.P
+Nous avons une fuite dans la R&D\~!
+La prochaine personne que je surprendrai à intégrer
+des échantillons d\[cq]ingénierie
+de nos processeurs Lightspeed Overdrive à 2048 cœurs
+dans des sous-verres en liège distribués
+lors de salons professionnels va le regretter.
+Aucun d\[cq]entre vous n\[cq]est digne de porter
+les bottes du maréchal Pétain.
+Tabarnac\~!
+.FC
+.SG
+.NS
+des imbéciles divers
+.NE
+.'
+
+output=$(echo "$input" | "$groff" -K utf8 -m m -m fr -T utf8 -P -cbou \
+    | sed '/^$/d')
+echo "$output"
+echo "$output" | od -c
+output=$(echo "$output" | od -t x1)
+echo "$output"
+
+echo "checking that escape sequences are handled between WA and WE" >&2
+# "Édouard"
+echo "$output" | grep -q '^0000360.*c3 89 64 6f 75 61 72 64' || wail
+
+echo "checking that escape sequences are handled between IA and IE" >&2
+# "ndé"
+echo "$output" | grep -q '^0000720 6e 64 c3 a9' || 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