gbranden pushed a commit to branch master
in repository groff.

commit bef3418179431d119a5a82b7314c91ff610d0f4d
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Sep 17 23:23:49 2025 -0500

    [troff]: Regression-test Savannah #67532.
    
    * src/roff/groff/tests/trf-request-works.sh: Add unit tests of `trf`
      request functionality in undiverted and diverted cases.
    
    Test fails at this commit.
---
 ChangeLog                                 |  7 ++++
 src/roff/groff/tests/trf-request-works.sh | 54 +++++++++++++++++++++++++------
 2 files changed, 52 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 80065558e..07531b345 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-09-17  G. Branden Robinson <[email protected]>
+
+       [troff]: Regression-test Savannah #67532.
+
+       * src/roff/groff/tests/trf-request-works.sh: Add unit tests of
+       `trf` request functionality in undiverted and diverted cases.
+
 2025-09-17  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/node.h (class zero_width_node): Declare
diff --git a/src/roff/groff/tests/trf-request-works.sh 
b/src/roff/groff/tests/trf-request-works.sh
index 87d33963a..0e686dab5 100755
--- a/src/roff/groff/tests/trf-request-works.sh
+++ b/src/roff/groff/tests/trf-request-works.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (C) 2025 Free Software Foundation, Inc.
+# Copyright 2025 G. Branden Robinson
 #
 # This file is part of groff.
 #
@@ -16,14 +16,15 @@
 #
 # 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"
 
-# Regression-test Savannah #66863.
-#
-# The `trf` request should not excessively advance the input stream
-# pointer.
+fail=
+
+wail () {
+  echo ...FAILED >&2
+  fail=YES
+}
 
 # Locate directory containing our test artifacts.
 artifact_dir=
@@ -43,14 +44,49 @@ done
 # If we can't find it, we can't test.
 test -z "$artifact_dir" && exit 77 # skip
 
-input=".
+comment='# this is a trout/grout comment'
+
+input1=".
+hello
+.trf $artifact_dir/throughput-file
+world
+."
+
+output=$(printf "%s" "$input1" | "$groff" -b -ww -Z)
+echo "$output"
+echo "checking that a transparent throughput file works" >&2
+echo "$output" | grep -Fqx "$comment" || wail
+
+# Regression-test Savannah #67532.
+#
+# A diverted throughput file's contents should not be formatted as text.
+
+input2=".
+.box DIV
 hello
 .trf $artifact_dir/throughput-file
 world
+.br
+.box
+.DIV
 ."
 
-output=$(printf "%s" "$input" | "$groff" -b -ww -a)
+output=$(printf "%s" "$input2" | "$groff" -b -ww -Z)
+echo "$output"
+echo "checking that a diverted transparent throughput file works" >&2
+echo "$output" | grep -Fqx "$comment" || wail
+
+# Regression-test Savannah #66863.
+#
+# The `trf` request should not excessively advance the input stream
+# pointer.
+
+output=$(printf "%s" "$input1" | "$groff" -b -ww -a)
 echo "$output"
-echo "$output" | grep -Fqx world
+echo "checking that 'trf' request advances input stream pointer" \
+  "correctly" >&2
+echo "$output" | grep -qx world || 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