groff-commit
[Top][All Lists]
Advanced

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

[groff] 18/80: Fix Savannah #66479 (2/2).


From: G. Branden Robinson
Subject: [groff] 18/80: Fix Savannah #66479 (2/2).
Date: Sat, 30 Nov 2024 04:02:14 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 8c97bb993c6f504fb4d2bfe4af1eff331b4db8e8
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Nov 27 03:14:53 2024 -0600

    Fix Savannah #66479 (2/2).
    
    * HACKING: Document another macOS od(1) irritation.
    
    * src/roff/groff/tests/dvi-device-smoke-test.sh: Work around macOS
      od(1)'s injection of extra spaces into its "-tx1" output.
    
    Fixes <https://savannah.gnu.org/bugs/?66479>.  Thanks to Sven Schober
    for the report, analysis, and for proposing fixes.
---
 ChangeLog                                     | 12 ++++++++++++
 HACKING                                       | 12 ++++++++++--
 src/roff/groff/tests/dvi-device-smoke-test.sh |  3 ++-
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b6ddb35b8..1a42e9f5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2024-11-27  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       Fix Savannah #66479 (2/2).
+
+       * HACKING: Document another macOS od(1) irritation.
+
+       * src/roff/groff/tests/dvi-device-smoke-test.sh: Work around
+       macOS od(1)'s injection of extra spaces into its "-tx1" output.
+
+       Fixes <https://savannah.gnu.org/bugs/?66479>.  Thanks to Sven
+       Schober for the report, analysis, and for proposing fixes.
+
 2024-11-27  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        Fix Savannah #66479 (1a/2).
diff --git a/HACKING b/HACKING
index 3c2c8adf9..97f08eaba 100644
--- a/HACKING
+++ b/HACKING
@@ -168,13 +168,21 @@ Here are some portability notes on writing automated 
tests.
 
 * The "od" command on macOS can put extra space characters (i.e., spaces
   that don't correspond to the input) at the ends of lines when using
-  the "od -t c" format; GNU od does not.
+  the "-t c" format; GNU od does not.
 
   So a regex like this that works with GNU od:
     grep -Eqx '0000000 +A +\\b +B +\\b +C       D +\\n'
-  might need to be weakened to the following on macOS.
+  might need to be weakened to the following to work on macOS.
     grep -Eqx '0000000 +A +\\b +B +\\b +C       D +\\n *'
 
+* The "od" command on macOS puts extra space characters between the
+  hexadecimal values when using the "-t x1" format; GNU od does not.
+
+  So a regex like this that works with GNU od:
+    grep -q '81 30 55 81 30 56 81 6c e2'
+  might need to be weakened to the following to work on macOS.
+    grep -q '81  *30  *55  *81  *30  *56  *81  *6c  *e2'
+
 * The "od" command on macOS does not respect the environment variable
   assignment "LC_ALL=C" when processing byte values 127<x<256 decimal
   and using the "character" output format (option "-t c").  An
diff --git a/src/roff/groff/tests/dvi-device-smoke-test.sh 
b/src/roff/groff/tests/dvi-device-smoke-test.sh
index d91bcfcaa..e2bc81f54 100755
--- a/src/roff/groff/tests/dvi-device-smoke-test.sh
+++ b/src/roff/groff/tests/dvi-device-smoke-test.sh
@@ -38,8 +38,9 @@ printf ".ft JPM\n$jstr\n" | "$groff" -Kutf8 -Tdvi -Z | tr 
'\n' ';' \
 
 # test for upTeX dvi with Japanese, DVI output
 echo "checking 'groff -Kutf8 -Tdvi'" >&2
+# 2 spaces before each '*'
 printf ".ft JPM\n$jstr" | "$groff" -Kutf8 -Tdvi | od -tx1 \
-  | grep -q '81 30 55 81 30 56 81 6c e2' || wail
+  | grep -q '81  *30  *55  *81  *30  *56  *81  *6c  *e2' || wail
 
 test -z "$fail"
 



reply via email to

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