gbranden pushed a commit to branch master
in repository groff.

commit 9c2fa7853d82eb5e1f4c524218cc08448e22bf44
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Oct 31 22:38:11 2025 -0500

    [groff]: Expand delimiter tests in compat mode.
    
    * src/roff/groff/tests/check-delimiter-validity.sh: Expand test coverage
      of delimiter usage in compatibility mode to account for the three
      different contexts in which delimiters can occur (and consequently the
      three different subsets of Unicode Basic Latin that are valid as
      delimiters in AT&T troff).
    
    Continues fixing Savannah #67408.
    
    Tests fail at this commit:
    
    src/roff/groff/tests/check-delimiter-validity.sh
    src/roff/groff/tests/logical-predicates-work.sh
---
 ChangeLog                                        |  8 +++++
 src/roff/groff/tests/check-delimiter-validity.sh | 46 +++++++++++++++++++++---
 2 files changed, 50 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cc3613528..6985b7e34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-10-31  G. Branden Robinson <[email protected]>
+
+       * src/roff/groff/tests/check-delimiter-validity.sh: Expand test
+       coverage of delimiter usage in compatibility mode to account for
+       the three different contexts in which delimiters can occur (and
+       consequently the three different subsets of Unicode Basic Latin
+       that are valid as delimiters in AT&T troff).
+
 2025-11-02  G. Branden Robinson <[email protected]>
 
        [groff]: Unit-test logical predicates.
diff --git a/src/roff/groff/tests/check-delimiter-validity.sh 
b/src/roff/groff/tests/check-delimiter-validity.sh
index ad4aefbe1..6717373b1 100755
--- a/src/roff/groff/tests/check-delimiter-validity.sh
+++ b/src/roff/groff/tests/check-delimiter-validity.sh
@@ -48,14 +48,52 @@ do
   echo "$output" | grep -qx 1n+2n_. || wail
 done
 
-# All of these work in DWB nroff.
+# Now test the context-dependent sets of delimiters of AT&T troff.
+
 for c in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
          a b c d e f g h i j k l m n o p q r s t u v w x y z \
          0 1 2 3 4 5 6 7 8 9 + - / '*' % '<' '>' = '&' : '(' ')' . '|'
 do
-  echo "checking validity of '$c' as delimiter in compatibility mode" \
-    >&2
-  output=$(printf '\\l%c1n+2n\\&_%c\n' "$c" "$c" \
+  echo "checking validity of '$c' as string expression delimiter" \
+    "in compatibility mode" >&2
+  output=$(printf '\\o%c__%c__\n' "$c" "$c" \
+    | "$groff" -C -T ascii -P -cbou | sed '/^$/d')
+  echo "$output"
+  echo "$output" | grep -Fqx ___ || wail
+done
+
+for c in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
+         a b c d e f g h i j k l m n o p q r s t u v w x y z \
+         0 1 2 3 4 5 6 7 8 9 . '|'
+do
+  echo "checking validity of '$c' as numeric expression delimiter" \
+    "in compatibility mode" >&2
+  output=$(printf '_\\h%c1n+2n%c_\n' "$c" "$c" \
+    | "$groff" -C -T ascii | sed '/^$/d')
+  echo "$output"
+  echo "$output" | grep -Fqx '_   _' || wail
+done
+
+# 'v' as a conditional expression operator is a vtroff extension, not a
+# GNU one.  vtroff is also unobtainium in the 21st century.  DWB 3.3,
+# Plan 9, and Solaris 10 troffs don't treat 'v' specially.
+#
+# TODO: Ideally, we should permit only AT&T-compatible (plus 'v'?)
+# operators when in compatibility mode.  (If you want the extensions,
+# use the `do` request.)  But that will demand hitting
+# `is_conditional_expression_true()` in "input.cpp" with a hammer, and
+# announcement of a behavior change in the "NEWS" file.
+#
+# If/when we do, change the following loop as shown.  And decide whether
+# to treat 'v' as an AT&Tism or a GNUism.
+#for c in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
+#         a b c d   f g h i j k l m     p q r s   u v w x y z
+for c in A B C D E   G H I J K L M N O P Q R   T U V W X Y Z \
+         a b       f g h i j k l       p q   s   u   w x y z
+do
+  echo "checking validity of '$c' as output comparison delimiter" \
+    "in compatibility mode" >&2
+  output=$(printf '.if %c@@@%c@@@%c ___\n' "$c" "$c" "$c" \
     | "$groff" -C -T ascii | sed '/^$/d')
   echo "$output"
   echo "$output" | grep -Fqx ___ || wail

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

Reply via email to