gbranden pushed a commit to branch master
in repository groff.

commit c4c11be3cb8ad95abea116374ef179f727b4d814
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Apr 16 08:33:52 2026 -0500

    [groff]: Unit-test alphabetic register formats.
    
    * src/roff/groff/tests/alpha-format-register-interpolation-works.sh: Do
      it.
    
    * src/roff/groff/groff.am (groff_TESTS): Run test.
---
 ChangeLog                                          |  8 +++
 src/roff/groff/groff.am                            |  1 +
 .../alpha-format-register-interpolation-works.sh   | 67 ++++++++++++++++++++++
 3 files changed, 76 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 31d355709..8daf5da7e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-04-16  G. Branden Robinson <[email protected]>
+
+       [groff]: Unit-test support for alphabetic register formats.
+
+       * src/roff/groff/tests/\
+       alpha-format-register-interpolation-works.sh: Do it.
+       * src/roff/groff/groff.am (groff_TESTS): Run test.
+
 2026-04-16  G. Branden Robinson <[email protected]>
 
        [groff]: Unit-test support for Roman numeral register formats.
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index fdd8292eb..225bba284 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -39,6 +39,7 @@ groff_TESTS = \
   src/roff/groff/tests/ab-request-works.sh \
   src/roff/groff/tests/adjustment-works.sh \
   src/roff/groff/tests/aln-request-works.sh \
+  src/roff/groff/tests/alpha-format-register-interpolation-works.sh \
   src/roff/groff/tests/als-request-works.sh \
   src/roff/groff/tests/arithmetic-works.sh \
   src/roff/groff/tests/asciify-composite-nodes-correctly.sh \
diff --git a/src/roff/groff/tests/alpha-format-register-interpolation-works.sh 
b/src/roff/groff/tests/alpha-format-register-interpolation-works.sh
new file mode 100755
index 000000000..6a5d0a20d
--- /dev/null
+++ b/src/roff/groff/tests/alpha-format-register-interpolation-works.sh
@@ -0,0 +1,67 @@
+#!/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"
+   fail=yes
+}
+
+# Unit-test alphabetic register interpolation format.
+#
+# Also test nonpositive register values.
+
+input='.
+.ec @
+.de PR
+.nr r @@$1
+.af r 0
+@@nr
+.ie @nU .af r A
+.el     .af r a
+@@nr
+.br
+..
+.PR -1
+.PR 0
+.PR 1
+.PR 26
+.PR 27
+.'
+
+output1=$(printf '%s\n' "$input" | "$groff" -T ascii)
+output1=$(echo $output1) # condense onto one line
+
+echo "checking that lowercase alphabetic register interpolation" \
+    "format works" >&2
+echo "$output1" | grep -qx -- "-1 -a 0 0 1 a 26 z 27 aa" || wail
+
+output2=$(printf '%s\n' "$input" | "$groff" -rU1 -T ascii)
+output2=$(echo $output2) # condense onto one line
+
+echo "checking that uppercase alphabetic register interpolation" \
+    "format works" >&2
+echo "$output2" | grep -qx -- "-1 -A 0 0 1 A 26 Z 27 AA" || 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