groff-commit
[Top][All Lists]
Advanced

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

[groff] 03/14: [tests]: Get rid of last Bashism known to me.


From: G. Branden Robinson
Subject: [groff] 03/14: [tests]: Get rid of last Bashism known to me.
Date: Mon, 1 Nov 2021 09:19:37 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit e9dcf2425837d21bd22611c48d790814b1e39bc1
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Oct 31 18:46:10 2021 +1100

    [tests]: Get rid of last Bashism known to me.
    
    * src/roff/groff/tests/string_case_xform_requests.sh: Migrate test to
      POSIX shell, dropping use of process substitution (a Bashism).  Also
      rewrite to stop using a here document within a command substitution,
      mainly for paranoia.
    
    Also update old ChangeLog entry; the above
    here-document-inside-a-command-substitution didn't provoke a bug in GNU
    Bash 3.2, but the one in the earlier entry did.  It appears to involve
    the presence of unpaired neutral apostrophes in the here document.
---
 ChangeLog                                          | 17 ++++++++++++-----
 src/roff/groff/tests/string_case_xform_requests.sh | 14 +++++---------
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 22cbe4a..529e569 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2021-10-31  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * src/roff/groff/tests/string_case_xform_requests.sh: Migrate
+       test to POSIX shell, dropping use of process substitution (a
+       Bashism).  Also rewrite to stop using a here document within a
+       command substitution, mainly for paranoia.
+
+2021-10-31  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * src/devices/grops/ps.cpp (encode_subfont): Update assertion to
        check for `sub` parameter being a null pointer rather than
        `sub->glyphs`; the latter is a member array of a `subencoding`
@@ -129,11 +136,11 @@
        sed semicolon problem.
 
        * src/roff/groff/tests/on_latin1_device_oq_is_0x27.sh: Rewrite
-       test to stop using a here document inside a command
-       substitution, which is broken in GNU Bash 3.2 and some other
-       versions.  Instead construct the input with printf(1).  Also
-       gets rid of a Bashism (process substitution) that Ingo pointed
-       out years ago.
+       test to stop using a here document (containing an unpaired
+       single quote) inside a command substitution, which is broken in
+       GNU Bash 3.2 and some other versions.  Instead construct the
+       input with printf(1).  Also gets rid of a Bashism (process
+       substitution) that Ingo pointed out years ago.
        * src/utils/grog/tests/recognize-perl-pod.sh: Same problem,
        different solution.  The Perl POD output is far too large to
        construct programmatically, so move it into an external file...
diff --git a/src/roff/groff/tests/string_case_xform_requests.sh 
b/src/roff/groff/tests/string_case_xform_requests.sh
index 0d85ebb..2c678c2 100755
--- a/src/roff/groff/tests/string_case_xform_requests.sh
+++ b/src/roff/groff/tests/string_case_xform_requests.sh
@@ -20,17 +20,13 @@
 
 groff="${abs_top_builddir:-.}/test-groff"
 
-expected="Résumé résumé RÉSUMÉ"
-
-actual=$("$groff" -Tutf8 <<EOF
-.pl 1v
+input=".pl 1v
 .ds resume R\\['e]sum\\['e]\\\"
 \\*[resume]
 .stringdown resume
 \\*[resume]
 .stringup resume
-\\*[resume]
-EOF
-)
-
-diff -u <(echo "$expected") <(echo "$actual")
+\\*[resume]"
+expected="Résumé résumé RÉSUMÉ"
+actual=$(echo "$input" | "$groff" -Tutf8)
+test "$actual" = "$expected"



reply via email to

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