grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.14-52-ga181ed9


From: Jim Meyering
Subject: grep branch, master, updated. v2.14-52-ga181ed9
Date: Thu, 24 Oct 2013 17:01:08 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  a181ed9a6778c313dda49b7d7921e4d700bb1d52 (commit)
      from  7a35413864e7e557050063a648caa452c38c160b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=a181ed9a6778c313dda49b7d7921e4d700bb1d52


commit a181ed9a6778c313dda49b7d7921e4d700bb1d52
Author: Jim Meyering <address@hidden>
Date:   Wed Oct 23 13:48:57 2013 -0700

    tests: port to bourne shells whose printf doesn't grok hex
    
    Use octal escapes, not hex, in printf(1) format strings,
    and in one case, use $AWK's printf so we can continue
    to use the table of hex values.
    * tests/char-class-multibyte: Use printf octal escapes, not hex,
    for portability to shells like dash and Solaris 10's /bin/sh.
    * tests/backslash-s-vs-invalid-multitype: Likewise.
    * tests/surrogate-pair: Likewise.
    * tests/unibyte-bracket-expr: Count in decimal and convert to octal.
    * tests/multibyte-white-space (hex_printf): New function.
    Use it in place of printf so we can retain the table of hex digits
    without hitting the limitation of some bourne shells.
    Reported by Paul Eggert in http://bugs.gnu.org/15690#11

diff --git a/tests/backslash-s-vs-invalid-multitype 
b/tests/backslash-s-vs-invalid-multitype
index 4f1a71d..9aff5a1 100755
--- a/tests/backslash-s-vs-invalid-multitype
+++ b/tests/backslash-s-vs-invalid-multitype
@@ -14,7 +14,7 @@ require_en_utf8_locale_
 LC_ALL=en_US.UTF-8
 export LC_ALL
 
-printf '\x82\n' > in || framework_failure_
+printf '\202\n' > in || framework_failure_
 
 fail=0
 grep '^\S$' in > out-S && fail=1
diff --git a/tests/char-class-multibyte b/tests/char-class-multibyte
index fae7511..459d10c 100755
--- a/tests/char-class-multibyte
+++ b/tests/char-class-multibyte
@@ -24,7 +24,7 @@ done
 
 for LOC in en_US.UTF-8 $LOCALE_FR_UTF8; do
   out=out3-$LOC
-  printf '\xc3\n' | LC_ALL=$LOC grep '[é]' > $out
+  printf '\303\n' | LC_ALL=$LOC grep '[é]' > $out
   test $? = 1 || fail=1
 done
 
diff --git a/tests/multibyte-white-space b/tests/multibyte-white-space
index 07ed085..16205fa 100755
--- a/tests/multibyte-white-space
+++ b/tests/multibyte-white-space
@@ -57,10 +57,18 @@ EOF
 
 fail=0
 
+# Like printf with a single argument.
+# The difference is that while some printf implementations fail to
+# handle \xHH escapes, no awk implementation has that problem.
+hex_printf()
+{
+   ${AWK-awk} 'BEGIN { printf "'"$1"'" }' </dev/null
+}
+
 for i in $utf8_space_characters; do
-  printf "$i\n" | grep -q '^\s$' \
+  hex_printf "$i\n" | grep -q '^\s$' \
       || { warn_ "$i FAILED to match \\s"; fail=1; }
-  printf "$i\n" | grep -q '\S'
+  hex_printf "$i\n" | grep -q '\S'
   test $? = 1 \
       || { warn_ "$i vs. \\S FAILED"; fail=1; }
 done
diff --git a/tests/surrogate-pair b/tests/surrogate-pair
index a589819..2d7d3bd 100755
--- a/tests/surrogate-pair
+++ b/tests/surrogate-pair
@@ -23,7 +23,7 @@ require_compiled_in_MB_support
 
 fail=0
 
-printf '\xf0\x90\x90\x85\n' > in || framework_failure_
+printf '\360\220\220\205\n' > in || framework_failure_
 
 LC_ALL=en_US.UTF-8
 export LC_ALL
diff --git a/tests/unibyte-bracket-expr b/tests/unibyte-bracket-expr
index 126a445..17a431d 100755
--- a/tests/unibyte-bracket-expr
+++ b/tests/unibyte-bracket-expr
@@ -27,14 +27,17 @@ export LC_ALL
 
 fail=0
 
-for i in 8 9 a b c d e f; do
-  for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
-    in=in-$i$j
-    b=$(printf "\\x$i$j")
-    echo "$b" > $in || framework_failure_
-    grep "[$b]" $in > out || fail=1
-    compare out $in || fail=1
-  done
+i=128
+while :; do
+  in=in-$i
+  octal=$(printf '%03o' $i)
+  b=$(printf "\\$octal")
+  echo "$b" > $in || framework_failure_
+  grep "[$b]" $in > out || fail=1
+  compare out $in || fail=1
+
+  test $i = 255 && break
+  i=$(expr $i + 1)
 done
 
 Exit $fail

-----------------------------------------------------------------------

Summary of changes:
 tests/backslash-s-vs-invalid-multitype |    2 +-
 tests/char-class-multibyte             |    2 +-
 tests/multibyte-white-space            |   12 ++++++++++--
 tests/surrogate-pair                   |    2 +-
 tests/unibyte-bracket-expr             |   19 +++++++++++--------
 5 files changed, 24 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

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