gbranden pushed a commit to branch master
in repository groff.
commit 3bf0c89eba6dedb598e744160132cd3a2dc855e8
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Jul 11 19:24:50 2026 -0500
[groff]: Add unit test for `hcode` request.
* src/roff/groff/tests/hcode-request-works.sh: Do it.
* src/roff/groff/groff.am (groff_TESTS): Run test.
Test fails at this commit.
---
ChangeLog | 7 ++++
src/roff/groff/groff.am | 1 +
src/roff/groff/tests/hcode-request-works.sh | 53 +++++++++++++++++++++++++++++
3 files changed, 61 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index eff7bb29d..c4f2a1d5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-07-11 G. Branden Robinson <[email protected]>
+
+ [groff]: Add unit test for `hcode` request.
+
+ * src/roff/groff/tests/hcode-request-works.sh: Do it.
+ * src/roff/groff/groff.am (groff_TESTS): Run test.
+
2026-07-07 G. Branden Robinson <[email protected]>
* src/roff/troff/node.cpp (zoom_font_request): Refactor. Call
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index ad8fa7df1..d3826046c 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -111,6 +111,7 @@ groff_TESTS = \
src/roff/groff/tests/handle-special-input-code-points.sh \
src/roff/groff/tests/handle-right-brace-escape-as-macro-argument.sh \
src/roff/groff/tests/hcode-request-copies-spec-char-code.sh \
+ src/roff/groff/tests/hcode-request-works.sh \
src/roff/groff/tests/hla-request-works.sh \
src/roff/groff/tests/html-device-smoke-test.sh \
src/roff/groff/tests/html-device-works-with-grn-and-eqn.sh \
diff --git a/src/roff/groff/tests/hcode-request-works.sh
b/src/roff/groff/tests/hcode-request-works.sh
new file mode 100755
index 000000000..39e618162
--- /dev/null
+++ b/src/roff/groff/tests/hcode-request-works.sh
@@ -0,0 +1,53 @@
+#!/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"
+ fail=yes
+}
+
+# Normally I dislike scraping diagnostic or other output to the standard
+# error stream, but trying to infer a character's hyphenation code from
+# its hyphenation behavior is a nightmare.
+
+input1='.
+.hcode a b
+.pchar a
+.'
+
+output1=$(printf '%s\n' "$input1" | "$groff" 2>&1)
+echo "$output1"
+echo "$output1" | grep -Fq 'hyphenation code: 98' || wail
+
+input2='.
+.hcode cd
+.pchar c
+.'
+
+output2=$(printf '%s\n' "$input2" | "$groff" 2>&1)
+echo "$output2"
+echo "$output2" | grep -Fq 'hyphenation code: 100' || 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