gbranden pushed a commit to branch master
in repository groff.

commit 7f0e55ae5f609d0184d0bddf1c57985362418c10
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Sep 17 23:52:58 2025 -0500

    [groff]: Add test case for asciify of div `'trf`.
    
    * src/roff/groff/tests/asciify-request-works.sh: Add test case for
      transformation of nodes produced by diverted `trf` requests.
---
 ChangeLog                                     |  5 +++++
 src/roff/groff/tests/asciify-request-works.sh | 28 ++++++++++++++++++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index d1b86fa7d..a2e7d9610 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-09-17  G. Branden Robinson <[email protected]>
+
+       * src/roff/groff/tests/asciify-request-works.sh: Add test case
+       for transformation of nodes produced by diverted `trf` requests.
+
 2025-09-17  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp: Trivially refactor.
diff --git a/src/roff/groff/tests/asciify-request-works.sh 
b/src/roff/groff/tests/asciify-request-works.sh
index 9061976ea..8aa33daf8 100755
--- a/src/roff/groff/tests/asciify-request-works.sh
+++ b/src/roff/groff/tests/asciify-request-works.sh
@@ -26,6 +26,26 @@ wail () {
   fail=YES
 }
 
+# Locate directory containing our test artifacts.
+artifact_dir=
+base=src/roff/groff/tests
+dir=artifacts
+
+for buildroot in . .. ../..
+do
+    d=$buildroot/$base/$dir
+    if [ -d "$d" ]
+    then
+        artifact_dir=$d
+        break
+    fi
+done
+
+# If we can't find it, we can't test.
+test -z "$artifact_dir" && exit 77 # skip
+
+comment='# this is a trout/grout comment'
+
 input='.
 .ec #
 !#?qux#?!
@@ -56,7 +76,9 @@ $%antimatter15@$b"hup"16@$c
 !sp
 .c2
 17@$D"l 1i 1i"18@$x".5v"19@$l"1i"20@$L"1i"21@$o"o+"22@$
-$O[0]fnord$O[1]23@$Z"visible"24@
+$O[0]fnord$O[1]23@$Z"visible"24@$c
+'"'trf $artifact_dir/throughput-file"'
+25@
 .br
 .box
 .asciify DIV2
@@ -164,6 +186,10 @@ 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 diverted 'trf' request" >&2
+echo "$output" | grep -q "$comment" && wail
+echo "$output" | grep -q '24@25' || wail
+
 test -z "$fail"
 
 # vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to