gbranden pushed a commit to branch master
in repository groff.

commit e10c392c1ff3cc8bf443354685023e657f7bd452
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Apr 19 08:53:31 2026 -0500

    [groff]: Add case to `dt` request test script.
    
    * src/roff/groff/tests/dt-request-works.sh: Add test case: a diversion
      trap is removed when `dt` is called with one argument.  If that
      argument is a valid numeric expression (albeit a meaningless one), the
      diversion's trap is removed.
---
 ChangeLog                                |  7 +++++++
 src/roff/groff/tests/dt-request-works.sh | 24 ++++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 04d48a96a..954440696 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-04-19  G. Branden Robinson <[email protected]>
+
+       * src/roff/groff/tests/dt-request-works.sh: Add test case: a
+       diversion trap is removed when `dt` is called with one argument.
+       If that argument is a valid numeric expression (albeit a
+       meaningless one), the diversion's trap is removed.
+
 2026-04-18  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/node.cpp: Slightly refactor.  Demote return
diff --git a/src/roff/groff/tests/dt-request-works.sh 
b/src/roff/groff/tests/dt-request-works.sh
index adfd0a47e..5bf3fc9dc 100755
--- a/src/roff/groff/tests/dt-request-works.sh
+++ b/src/roff/groff/tests/dt-request-works.sh
@@ -75,6 +75,30 @@ echo "$output2"
 output2=$(echo $output2) # condense onto one line
 echo "$output2" | grep -q "foo bar baz" || wail
 
+# Test trap removal when given one argument.
+
+input3='.
+.de TT
+WHOOPS
+.br
+..
+.di DD
+.dt 3v
+.nf
+foo
+bar
+.dt
+.sp
+baz
+.di
+.DD
+.'
+
+output3=$(printf '%s\n' "$input3" | "$groff" -a 2>/dev/null)
+echo "$output3"
+output3=$(echo $output3) # condense onto one line
+echo "$output3" | grep -q "foo bar baz" || 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

Reply via email to