gbranden pushed a commit to branch master
in repository groff.

commit 45afde2cbcc307f7b574d88205bc1cf0581ec161
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Mar 9 20:19:31 2026 -0500

    [troff]: Regression-test Savannah #68132.
    
    * src/roff/groff/tests/do-not-abort-applying-tr-request-to-non-char.sh:
      Do it.
    
    * src/roff/groff/groff.am (groff_TESTS): Run test.
    
    Test fails at this commit.
---
 ChangeLog                                          |  8 ++++
 src/roff/groff/groff.am                            |  1 +
 ...do-not-abort-applying-tr-request-to-non-char.sh | 52 ++++++++++++++++++++++
 3 files changed, 61 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 4ab39a190..c43afea90 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-03-09  G. Branden Robinson <[email protected]>
+
+       [troff]: Regression-test Savannah #68132.
+
+       * src/roff/groff/tests/\
+       do-not-abort-applying-tr-request-to-non-char.sh: Do it.
+       * src/roff/groff/groff.am (groff_TESTS): Run test.
+
 2026-03-08  Deri James  <[email protected]>
 
        * src/devices/gropdf/gropdf.pl: Seed random number generator if
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 88d95f23c..a3f4317f7 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -64,6 +64,7 @@ groff_TESTS = \
   src/roff/groff/tests/device-request-passes-most-escape-sequences.sh \
   src/roff/groff/tests/device-request-works.sh \
   src/roff/groff/tests/devicem-request-works.sh \
+  src/roff/groff/tests/do-not-abort-applying-tr-request-to-non-char.sh \
   src/roff/groff/tests/do-not-crash-on-mismatched-diversion-request.sh \
   src/roff/groff/tests/do-not-free-file-name-pointers-early.sh \
   src/roff/groff/tests/do-not-loop-infinitely-when-breaking-cjk.sh \
diff --git 
a/src/roff/groff/tests/do-not-abort-applying-tr-request-to-non-char.sh 
b/src/roff/groff/tests/do-not-abort-applying-tr-request-to-non-char.sh
new file mode 100755
index 000000000..0849177ae
--- /dev/null
+++ b/src/roff/groff/tests/do-not-abort-applying-tr-request-to-non-char.sh
@@ -0,0 +1,52 @@
+#!/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 over
+# 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
+}
+
+# troff should not throw an assertion failure when the user attempts to
+# apply the `tr` request to non-character input.  Savannah #68132.
+
+input='.
+.nf
+.tr a\|
+HAPAX
+.tr \^b
+LEGOMENON
+.'
+
+output=$(printf '%s\n' "$input" | "$groff" -a)
+
+echo "checking that translating character to non-character does not" \
+    "abort formatter" >&2
+echo "$output" | grep -Fqx "HAPAX" || wail
+
+echo "checking that translating non-character to character does not" \
+    "abort formatter" >&2
+echo "$output" | grep -Fqx "LEGOMENON" || 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