gbranden pushed a commit to branch master
in repository groff.
commit a89ea2475a630336eee3f16e674e6095c04ccdaf
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Jun 10 11:34:48 2026 -0500
[tbl]: Improve test script. (2/2)
* src/preproc/tbl/tests/do-not-segv-when-backslash-R-in-text-block.sh:
Revise test to stop using the presence of a "core" file as a failure
oracle. Instead, pattern-match tbl(1)'s output for the `TE` macro
call that gets issed only after the formerly buggy table processing
completes successfully.
Fixes <https://savannah.gnu.org/bugs/?68204>.
Also modernize shell style to align with more recent groff tests.
---
ChangeLog | 11 +++++++++
.../do-not-segv-when-backslash-R-in-text-block.sh | 27 +++++++++++-----------
2 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3bca60ef3..fcbabefec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2026-06-10 G. Branden Robinson <[email protected]>
+
+ * src/preproc/tbl/tests/\
+ do-not-segv-when-backslash-R-in-text-block.sh: Revise test to
+ stop using the presence of a "core" file as a failure oracle.
+ Instead, pattern-match tbl(1)'s output for the `TE` macro call
+ that gets issed only after the formerly buggy table processing
+ completes successfully.
+
+ Fixes <https://savannah.gnu.org/bugs/?68204>.
+
2026-06-10 G. Branden Robinson <[email protected]>
* src/preproc/tbl/tests/\
diff --git
a/src/preproc/tbl/tests/do-not-segv-when-backslash-R-in-text-block.sh
b/src/preproc/tbl/tests/do-not-segv-when-backslash-R-in-text-block.sh
index d16ac9e6b..a709eb8f1 100755
--- a/src/preproc/tbl/tests/do-not-segv-when-backslash-R-in-text-block.sh
+++ b/src/preproc/tbl/tests/do-not-segv-when-backslash-R-in-text-block.sh
@@ -19,6 +19,7 @@
#
groff="${abs_top_builddir:-.}/test-groff"
+tbl="${abs_top_builddir:-.}/tbl"
fail=
@@ -32,13 +33,8 @@ wail () {
# Do not SEGV when a text block begins with a repeating glyph token, and
# do not malformat the output if it ends with one.
-if [ -e core ]
-then
- echo "$0: 'core' file already exists; skipping" >&2
- exit 77 # skip
-fi
-
-input='.TS
+input='.
+.TS
L.
T{
\Ra
@@ -58,21 +54,26 @@ foo
\Ra
bar
T}
-.TE'
+.TE
+.'
+
+tbl_output=$(printf '%s\n' "$input" | "$tbl")
+printf '%s\n' "$tbl_output"
-output=$(printf "%s\n" "$input" | "$groff" -t -Tascii -P-cbou)
+groff_output=$(printf '%s\n' "$input" | "$groff" -t -Tascii -P-cbou)
+printf '%s\n' "$groff_output"
echo "checking that tbl doesn't segfault" >&2
-test -f core && wail
+printf '%s\n' "$tbl_output" | grep -Fqx ".TE" || wail
echo "checking text block starting with repeating glyph" >&2
-echo "$output" | sed -n 1p | grep -qx 'a' || wail
+printf '%s\n' "$groff_output" | sed -n 1p | grep -qx 'a' || wail
echo "checking text block ending with repeating glyph" >&2
-echo "$output" | sed -n 2p | grep -qx 'foo a' || wail
+printf '%s\n' "$groff_output" | sed -n 2p | grep -qx 'foo a' || wail
echo "checking text block containing repeating glyph" >&2
-echo "$output" | sed -n 3p | grep -qx 'foo a bar' || wail
+printf '%s\n' "$groff_output" | sed -n 3p | grep -qx 'foo a bar' || wail
test -z "$fail"
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit