groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 06/127: [tbl]: Update conventions used in test script.


From: G. Branden Robinson
Subject: [groff] 06/127: [tbl]: Update conventions used in test script.
Date: Mon, 10 Jul 2023 04:30:15 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 38a9451d75d2041b6076cd15f1c20cb70ca192b2
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Apr 28 05:06:38 2023 -0500

    [tbl]: Update conventions used in test script.
    
    * src/preproc/tbl/tests/save-and-restore-hyphenation-parameters.sh:
      Migrate to more recent test conventions, emitting the formatted output
      and updating the style of shell usage.  Eliminate use of hard tabs in
      table, for readability.  Use table format case convention now
      exemplified in tbl(1) man page.
---
 .../save-and-restore-hyphenation-parameters.sh     | 30 ++++++++++++++--------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/src/preproc/tbl/tests/save-and-restore-hyphenation-parameters.sh 
b/src/preproc/tbl/tests/save-and-restore-hyphenation-parameters.sh
index e368b31ee..f2334b0e2 100755
--- a/src/preproc/tbl/tests/save-and-restore-hyphenation-parameters.sh
+++ b/src/preproc/tbl/tests/save-and-restore-hyphenation-parameters.sh
@@ -20,21 +20,27 @@
 
 groff="${abs_top_builddir:-.}/test-groff"
 
-set -e
+fail=
+
+wail () {
+    echo ...FAILED >&2
+    fail=YES
+}
 
 # Regression-test Savannah #59971.
 #
 # Hyphenation needs to be restored between (and after) text blocks just
 # as adjustment is.
 
-EXAMPLE='.nr LL 78n
+input='.nr LL 78n
 .hw a-bc-def-ghij-klmno-pqrstu-vwxyz
 .LP
 Here is a table with hyphenation disabled in its text block.
 .
 .TS
-l lx.
-foo    T{
+tab(@);
+L Lx.
+foo@T{
 .nh
 abcdefghijklmnopqrstuvwxyz
 abcdefghijklmnopqrstuvwxyz
@@ -45,14 +51,16 @@ T}
 Let us see if hyphenation is enabled again as it should be.
 abcdefghijklmnopqrstuvwxyz'
 
-OUTPUT=$(printf "%s\n" "$EXAMPLE" | "$groff" -Tascii -P-cbou -t -ms)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -t -ms)
+
+echo "$output"
 
-echo "$OUTPUT"
+echo "checking whether hyphenation disabled in table text block" >&2
+echo "$output" | grep '^foo' | grep -- '-$' && wail
 
-echo "testing whether hyphenation disabled in table text block" >&2
-! echo "$OUTPUT" | grep '^foo' | grep -- '-$'
+echo "checking whether hyphenation enabled after table" >&2
+echo "$output" | grep -qx 'Let us see.*lmno-' || wail
 
-echo "testing whether hyphenation enabled after table" >&2
-echo "$OUTPUT" | grep -qx 'Let us see.*lmno-'
+test -z "$fail"
 
-# vim:set ai noet sw=4 ts=4 tw=72:
+# vim:set ai et sw=4 ts=4 tw=72:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]