gbranden pushed a commit to branch master
in repository groff.
commit 8f2cc8fddf2354caf9571999c8932f5aa5c5dfe8
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon May 4 18:19:52 2026 -0500
[groff]: Test asciification in nroff mode.
* src/roff/groff/tests/asciify-request-works.sh: Test sample input not
just with "ps" output device, but "utf8" as well. Exclude two checks
when producing output for the latter; one because it's an as yet
unimplemented feature, and the other because the feature (ligature
rendering) is unsupported in nroff mode. This is to catch more cases
like Savannah #68303.
---
ChangeLog | 9 ++
src/roff/groff/tests/asciify-request-works.sh | 158 ++++++++++++++------------
2 files changed, 94 insertions(+), 73 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d14df5409..c08567ec6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2026-05-04 G. Branden Robinson <[email protected]>
+
+ * src/roff/groff/tests/asciify-request-works.sh: Test sample
+ input not just with "ps" output device, but "utf8" as well.
+ Exclude two checks when producing output for the latter; one
+ because it's an as yet unimplemented feature, and the other
+ because the feature (ligature rendering) is unsupported in nroff
+ mode. This is to catch more cases like Savannah #68303.
+
2026-05-04 G. Branden Robinson <[email protected]>
* src/roff/troff/node.cpp (left_italic_corrected_node::asciify):
diff --git a/src/roff/groff/tests/asciify-request-works.sh
b/src/roff/groff/tests/asciify-request-works.sh
index a6fd6ff2d..b95e746de 100755
--- a/src/roff/groff/tests/asciify-request-works.sh
+++ b/src/roff/groff/tests/asciify-request-works.sh
@@ -87,111 +87,123 @@ $O[0]fnord$O[1]23@$Z"visible"24@$c
.ec
.'
-output=$(printf "%s\n" "$input" | "$groff" -T ps -a)
-echo "$output"
+for d in ps utf8
+do
+ output=$(printf "%s\n" "$input" | "$groff" -T $d -a -W break)
+ echo "testing device '$d'..." >&2
+ echo "$output"
-echo "checking textification of ordinary character 'A'" >&2
-echo "$output" | grep -q ' A' || wail
+ echo "checking textification of ordinary character 'A'" >&2
+ echo "$output" | grep -q ' A' || wail
-echo "checking textification of special character 'dq'" >&2
-echo "$output" | grep -q '<dq>' || wail
+ echo "checking textification of special character 'dq'" >&2
+ echo "$output" | grep -q '<dq>' || wail
-echo "checking textification of composite special character 'e aa'" >&2
-echo "$output" | grep -q "<'e>" || wail
+ echo "checking textification of composite special character 'e aa'" >&2
+ echo "$output" | grep -q "<'e>" || wail
-echo "checking textification of Unicode special character with Latin-1" \
- "mapping 'u00E1'" >&2
-echo "$output" | grep -q "<'a>" || wail
+ echo "checking textification of Unicode special character with Latin-1" \
+ "mapping 'u00E1'" >&2
+ echo "$output" | grep -q "<'a>" || wail
-echo "checking textification of decomposable (with Basic Latin base" \
- "character) Unicode special character 'u0106'" >&2
-echo "$output" | grep -q "C<aa>" || wail
+ # XXX: Unfortunately we don't handle this in nroff mode yet.
+ if [ $d != utf8 ]
+ then
+ echo "checking textification of decomposable (with Basic Latin base" \
+ "character) Unicode special character 'u0106'" >&2
+ echo "$output" | grep -q "C<aa>" || wail
+ fi
-# TODO: See "test this" above.
-# The fallback character definition in ps.tmac gives us grief.
-#echo "checking textification of ligature special character 'fl'" >&2
-#echo "$output" | grep -q "i<fl>" || wail
+ # TODO: See "test this" above.
+ # The fallback character definition in ps.tmac gives us grief.
+ #echo "checking textification of ligature special character 'fl'" >&2
+ #echo "$output" | grep -q "i<fl>" || wail
-echo "checking textification of ligature special character 'Fl'" >&2
-echo "$output" | grep -q "of<fl>" || wail
+ # We _documentedly_ don't handle ligatures in nroff mode.
+ if [ $d != utf8 ]
+ then
+ echo "checking textification of ligature special character 'Fl'" >&2
+ echo "$output" | grep -q "of<fl>" || wail
+ fi
-echo "checking textification of user-defined special character 'Z'" >&2
-echo "$output" | grep -q "ZYX" || wail
+ echo "checking textification of user-defined special character 'Z'" >&2
+ echo "$output" | grep -q "ZYX" || wail
-echo "checking textification of dummy character escape sequence" >&2
-echo "$output" | grep -q "1@2" || wail
+ echo "checking textification of dummy character escape sequence" >&2
+ echo "$output" | grep -q "1@2" || wail
-echo "checking textification of EOS-transparent dummy character" \
- "escape sequence" >&2
-echo "$output" | grep -q "2@3" || wail
+ echo "checking textification of EOS-transparent dummy character" \
+ "escape sequence" >&2
+ echo "$output" | grep -q "2@3" || wail
-echo "checking textification of output line continuation escape" \
- "sequence" >&2
-echo "$output" | grep -q "3@4" || wail
+ echo "checking textification of output line continuation escape" \
+ "sequence" >&2
+ echo "$output" | grep -q "3@4" || wail
-echo "checking textification of tag request" >&2
-echo "$output" | grep -q "4@5" || wail
+ echo "checking textification of tag request" >&2
+ echo "$output" | grep -q "4@5" || wail
-echo "checking textification of device extension escape sequence" >&2
-echo "$output" | grep -q "5@6" || wail
+ echo "checking textification of device extension escape sequence" >&2
+ echo "$output" | grep -q "5@6" || wail
-echo "checking textification of vertical motion escape sequence" >&2
-echo "$output" | grep -q "6@7" || wail
+ echo "checking textification of vertical motion escape sequence" >&2
+ echo "$output" | grep -q "6@7" || wail
-echo "checking textification of (tab) horizontal motion escape sequence" >&2
-echo "$output" | grep -q "7@8" || wail
+ echo "checking textification of (tab) horizontal motion escape sequence"
>&2
+ echo "$output" | grep -q "7@8" || wail
-echo "checking textification of (plain) horizontal motion escape sequence" >&2
-echo "$output" | grep -q "8@9" || wail
+ echo "checking textification of (plain) horizontal motion escape sequence"
>&2
+ echo "$output" | grep -q "8@9" || wail
-echo "checking textification of unadjustable space escape sequence" >&2
-echo "$output" | grep -q "9@ 10" || wail
+ echo "checking textification of unadjustable space escape sequence" >&2
+ echo "$output" | grep -q "9@ 10" || wail
-echo "checking textification of unbreakable space escape sequence" >&2
-echo "$output" | grep -q "10@ 11" || wail
+ echo "checking textification of unbreakable space escape sequence" >&2
+ echo "$output" | grep -q "10@ 11" || wail
-echo "checking textification of hyphenless break point escape sequence" >&2
-echo "$output" | grep -q "11@12" || wail
+ echo "checking textification of hyphenless break point escape sequence" >&2
+ echo "$output" | grep -q "11@12" || wail
-echo "checking textification of uninterpreted leader escape sequence" >&2
-echo "$output" | grep -q "12@13" || wail
+ echo "checking textification of uninterpreted leader escape sequence" >&2
+ echo "$output" | grep -q "12@13" || wail
-echo "checking textification of non-diverted uninterpreted character sequence
escape sequence" >&2
-echo "$output" | grep -q '!!' || wail
+ echo "checking textification of non-diverted uninterpreted character
sequence escape sequence" >&2
+ echo "$output" | grep -q '!!' || wail
-echo "checking textification of diverted uninterpreted character sequence
escape sequence" >&2
-echo "$output" | grep -q '13@jat14' || wail
+ echo "checking textification of diverted uninterpreted character sequence
escape sequence" >&2
+ echo "$output" | grep -q '13@jat14' || wail
-echo "checking textification of hyphenation inhibitor escape sequence" >&2
-echo "$output" | grep -q '^antimatter15' || wail
+ echo "checking textification of hyphenation inhibitor escape sequence" >&2
+ echo "$output" | grep -q '^antimatter15' || wail
-echo "checking textification of bracket-building escape sequence" >&2
-echo "$output" | grep -q '15@16' || wail
+ echo "checking textification of bracket-building escape sequence" >&2
+ echo "$output" | grep -q '15@16' || wail
-echo "checking textification of diverted 'sp' request" >&2
-echo "$output" | grep -q '16@17' || wail
+ echo "checking textification of diverted 'sp' request" >&2
+ echo "$output" | grep -q '16@17' || wail
-echo "checking textification of drawing escape sequence" >&2
-echo "$output" | grep -q '17@18' || wail
+ echo "checking textification of drawing escape sequence" >&2
+ echo "$output" | grep -q '17@18' || wail
-echo "checking textification of extra leading escape sequence" >&2
-echo "$output" | grep -q '18@19' || wail
+ echo "checking textification of extra leading escape sequence" >&2
+ echo "$output" | grep -q '18@19' || wail
-echo "checking textification of horizontal rule escape sequence" >&2
-echo "$output" | grep -q '19@20' || wail
+ echo "checking textification of horizontal rule escape sequence" >&2
+ echo "$output" | grep -q '19@20' || wail
-echo "checking textification of vertical rule escape sequence" >&2
-echo "$output" | grep -q '20@21' || wail
+ echo "checking textification of vertical rule escape sequence" >&2
+ echo "$output" | grep -q '20@21' || wail
-echo "checking textification of overstriking escape sequence" >&2
-echo "$output" | grep -q '21@22' || wail
+ echo "checking textification of overstriking escape sequence" >&2
+ echo "$output" | grep -q '21@22' || wail
-echo "checking textification of drawing position reset escape sequence" >&2
-echo "$output" | grep -q '23@visible24' || wail
+ echo "checking textification of drawing position reset escape sequence" >&2
+ echo "$output" | grep -q '23@visible24' || wail
-echo "checking textification of diverted 'trf' request" >&2
-echo "$output" | grep -q "$comment" && wail
-echo "$output" | grep -q '24@25' || wail
+ echo "checking textification of diverted 'trf' request" >&2
+ echo "$output" | grep -q "$comment" && wail
+ echo "$output" | grep -q '24@25' || wail
+done
test -z "$fail"
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit