groff-commit
[Top][All Lists]
Advanced

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

[groff] 05/126: [tbl]: Update conventions used in test script.


From: G. Branden Robinson
Subject: [groff] 05/126: [tbl]: Update conventions used in test script.
Date: Wed, 5 Jul 2023 17:02:44 -0400 (EDT)

gbranden pushed a commit to branch branden-2023-07-05
in repository groff.

commit eecf96ebb4559b5819df4acb43553880a6b519f6
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]