gbranden pushed a commit to branch master
in repository groff.
commit 36b96b67ea4be7856ce06fc906959d05dff83a8a
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Nov 22 23:29:45 2026 -0600
[groff]: Unit-test `pev` request.
* src/roff/groff/tests/error-pev-request-given-bogus-argument.sh
* src/roff/groff/tests/pev-request-works.sh: New files; do it.
* src/roff/groff/groff.am: Update `groff_TESTS` to run tests.
Continues fixing <https://savannah.gnu.org/bugs/?68905>.
---
ChangeLog | 5 +++
src/roff/groff/groff.am | 2 +
.../error-pev-request-given-bogus-argument.sh | 22 ++++++++++
src/roff/groff/tests/pev-request-works.sh | 49 ++++++++++++++++++++++
4 files changed, 78 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 4ba24cef6..cf503e6da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,11 @@
arguments; interpret each as an environment identifier, and dump
the properties thereof if it exists.
+ * src/roff/groff/tests/error-pev-request-given-bogus-argument.sh
+ * src/roff/groff/tests/pev-request-works.sh: New files; test it.
+
+ * src/roff/groff/groff.am: Update `groff_TESTS` to run tests.
+
2026-11-22 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp (struct grostream): Declare new
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 16f044758..85b0aa048 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -119,6 +119,7 @@ groff_TESTS = \
src/roff/groff/tests/error-no-space-between-dt-or-wh-arguments.sh \
src/roff/groff/tests/error-overflow-symbol-table.sh \
src/roff/groff/tests/error-pcolor-request-given-bogus-argument.sh \
+ src/roff/groff/tests/error-pev-request-given-bogus-argument.sh \
src/roff/groff/tests/error-pfp-request-given-bogus-argument.sh \
src/roff/groff/tests/error-pftr-request-given-bogus-argument.sh \
src/roff/groff/tests/error-pi-request-given-empty-argument.sh \
@@ -161,6 +162,7 @@ groff_TESTS = \
src/roff/groff/tests/output-request-works.sh \
src/roff/groff/tests/pchar-request-works.sh \
src/roff/groff/tests/pdf-device-smoke-test.sh \
+ src/roff/groff/tests/pev-request-works.sh \
src/roff/groff/tests/pfp-request-works.sh \
src/roff/groff/tests/pftr-request-works.sh \
src/roff/groff/tests/phw-request-skips-line-if-no-hyph-lang.sh \
diff --git a/src/roff/groff/tests/error-pev-request-given-bogus-argument.sh
b/src/roff/groff/tests/error-pev-request-given-bogus-argument.sh
new file mode 100755
index 000000000..c34e21dce
--- /dev/null
+++ b/src/roff/groff/tests/error-pev-request-given-bogus-argument.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# 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"
+
+output=$(printf '.pev \002\n' | "$groff" -T ascii)
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/src/roff/groff/tests/pev-request-works.sh
b/src/roff/groff/tests/pev-request-works.sh
new file mode 100755
index 000000000..4fe3c9d37
--- /dev/null
+++ b/src/roff/groff/tests/pev-request-works.sh
@@ -0,0 +1,49 @@
+#!/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 >&2
+ fail=YES
+}
+
+input='.
+.pev 0
+.ev 1
+.ft TI
+.pev 1
+.'
+
+error=$(printf '%s\n' "$input" | "$groff" -T ps 2>&1)
+#echo "$error"
+
+echo 'checking report of environment 0' >&2
+echo "$error" | sed '/environment 1:/,$d' \
+ | grep -Fq "resolved font selection: 1 ('TR')" || wail
+
+echo 'checking report of environment 1' >&2
+echo "$error" | sed '1,/environment 1:/d' \
+ | grep -Eq "resolved font selection: [0-9]+ \('TI'\)" || 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