gbranden pushed a commit to branch master
in repository groff.

commit f2669cd979568575b4f45a7a7730f2ef71344431
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Apr 14 06:04:02 2026 -0500

    [groff]: Unit-test `aln` and `als` requests.
    
    * src/roff/groff/tests/aln-request-works.sh:
    * src/roff/groff/tests/als-request-works.sh: Do it.
    
    * src/roff/groff/groff.am (groff_TESTS): Run tests.
---
 ChangeLog                                 |  8 +++++
 src/roff/groff/groff.am                   |  2 ++
 src/roff/groff/tests/aln-request-works.sh | 50 +++++++++++++++++++++++++++++++
 src/roff/groff/tests/als-request-works.sh | 50 +++++++++++++++++++++++++++++++
 4 files changed, 110 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 1e3e725df..363465f58 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-04-14  G. Branden Robinson <[email protected]>
+
+       [groff]: Unit-test `aln` and `als` requests.
+
+       * src/roff/groff/tests/aln-request-works.sh:
+       * src/roff/groff/tests/als-request-works.sh: Do it.
+       * src/roff/groff/groff.am (groff_TESTS): Run tests.
+
 2026-04-14  G. Branden Robinson <[email protected]>
 
        [troff]: Slightly refactor.  Migrate GNU troff's `dictionary`
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index a1e45e020..f159ae3db 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -38,6 +38,8 @@ EXTRA_DIST += src/roff/groff/groff.1.man
 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/als-request-works.sh \
   src/roff/groff/tests/arithmetic-works.sh \
   src/roff/groff/tests/asciify-composite-nodes-correctly.sh \
   src/roff/groff/tests/asciify-request-works.sh \
diff --git a/src/roff/groff/tests/aln-request-works.sh 
b/src/roff/groff/tests/aln-request-works.sh
new file mode 100755
index 000000000..0fbf1887c
--- /dev/null
+++ b/src/roff/groff/tests/aln-request-works.sh
@@ -0,0 +1,50 @@
+#!/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 `aln` request.
+
+input='.
+.nr foo 1
+.aln bar foo
+bar=\n[bar]
+.aln baz qux
+.'
+
+echo "checking that 'aln' request works" >&2
+output=$(printf '%s\n' "$input" | "$groff" -a 2>/dev/null)
+echo "$output"
+echo "$output" | grep -qx "bar=1" || wail
+
+echo "checking that 'aln' request produces error when it should" >&2
+error=$(printf '%s\n' "$input" | "$groff" -z 2>&1)
+echo "$error"
+test -n "$error" || wail
+
+test -z "$fail"
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/src/roff/groff/tests/als-request-works.sh 
b/src/roff/groff/tests/als-request-works.sh
new file mode 100755
index 000000000..17d948942
--- /dev/null
+++ b/src/roff/groff/tests/als-request-works.sh
@@ -0,0 +1,50 @@
+#!/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 `als` request.
+
+input='.
+.ds foo FOO
+.als bar foo
+bar=\*[bar]
+.als baz qux
+.'
+
+echo "checking that 'als' request works" >&2
+output=$(printf '%s\n' "$input" | "$groff" -a 2>/dev/null)
+echo "$output"
+echo "$output" | grep -qx "bar=FOO" || wail
+
+echo "checking that 'als' request produces error when it should" >&2
+error=$(printf '%s\n' "$input" | "$groff" -z 2>&1)
+echo "$error"
+test -n "$error" || 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