grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.6.1-25-gfaeb834


From: Paolo Bonzini
Subject: grep branch, master, updated. v2.6.1-25-gfaeb834
Date: Mon, 29 Mar 2010 08:24:01 +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  faeb8340a6635a8e5e3177da547a938d387ce778 (commit)
       via  6d952beebdac1d8f31ba20abb12a756a9877e50d (commit)
      from  c2b9a4fed35d198b8af8f38af877b8d1d52ec6f1 (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=faeb8340a6635a8e5e3177da547a938d387ce778


commit faeb8340a6635a8e5e3177da547a938d387ce778
Author: Paolo Bonzini <address@hidden>
Date:   Mon Mar 29 08:49:42 2010 +0200

    tests: add tests for SJIS character sets
    
    The attached test will be skipped unless (on a glibc system) you run
    something like
    
      mkdir /usr/lib/locale/ja_JP.SHIFT_JIS
      zcat /usr/share/i18n/charmaps/SHIFT_JIS.gz | \
        localedef \
          -f - \
          -i /usr/share/i18n/locales/ja_JP \
          /usr/lib/locale/ja_JP.SHIFT_JIS
    
    * tests/Makefile.am: Add sjis-mb.
    * tests/sjis-mb: New.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3caeb78..6920d21 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -41,6 +41,7 @@ TESTS =                                               \
   pcre.sh                                      \
   pcre-z                                       \
   reversed-range-endpoints                     \
+  sjis-mb                                      \
   spencer1.sh                                  \
   spencer1-locale                              \
   status.sh                                    \
diff --git a/tests/sjis-mb b/tests/sjis-mb
new file mode 100644
index 0000000..4454ea1
--- /dev/null
+++ b/tests/sjis-mb
@@ -0,0 +1,50 @@
+#!/bin/sh
+# similar to euc-mb and fgrep-infloop, but tests SJIS encoding.
+# in this encoding, an ASCII character is both a valid single-byte
+# character, and a suffix of a valid double-byte character
+
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ ../src
+
+require_timeout_
+
+# % becomes a half-width katakana in SJIS, and an invalid sequence
+# in UTF-8.  Use this to try skipping implementations that do not
+# support SJIS.
+encode() { echo "$1" | tr @% '\203\301'; }
+
+k=0
+test_grep_reject() {
+  k=$(expr $k + 1)
+  encode "$2" | \
+    LC_ALL=ja_JP.SHIFT_JIS \
+      timeout 10s grep $1 $(encode "$3") > out$k 2>&1
+  test $? = 1
+}
+
+test_grep() {
+  k=$(expr $k + 1)
+  encode "$2" > exp$k
+  LC_ALL=ja_JP.SHIFT_JIS \
+    timeout 10s grep $1 $(encode "$3") exp$k > out$k 2>&1
+  test $? = 0 && compare out$k exp$k
+}
+
+test_grep_reject -F @@ @ || skip_ 'system does not seem to know about SJIS'
+test_grep -F %%AA A || skip_ 'system seems to treat SJIS the same as UTF-8'
+
address@hidden
+successful_tests='%%AA @AA @A@@A'
+
+fail=0
+for i in $successful_tests; do
+  test_grep -F $i A || fail=1
+  test_grep -E $i A || fail=1
+done
+
+for i in $failure_tests; do
+  test_grep_reject -F $i A || fail=1
+  test_grep_reject -E $i A || fail=1
+done
+
+Exit $fail

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=6d952beebdac1d8f31ba20abb12a756a9877e50d


commit faeb8340a6635a8e5e3177da547a938d387ce778
Author: Paolo Bonzini <address@hidden>
Date:   Mon Mar 29 08:49:42 2010 +0200

    tests: add tests for SJIS character sets
    
    The attached test will be skipped unless (on a glibc system) you run
    something like
    
      mkdir /usr/lib/locale/ja_JP.SHIFT_JIS
      zcat /usr/share/i18n/charmaps/SHIFT_JIS.gz | \
        localedef \
          -f - \
          -i /usr/share/i18n/locales/ja_JP \
          /usr/lib/locale/ja_JP.SHIFT_JIS
    
    * tests/Makefile.am: Add sjis-mb.
    * tests/sjis-mb: New.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3caeb78..6920d21 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -41,6 +41,7 @@ TESTS =                                               \
   pcre.sh                                      \
   pcre-z                                       \
   reversed-range-endpoints                     \
+  sjis-mb                                      \
   spencer1.sh                                  \
   spencer1-locale                              \
   status.sh                                    \
diff --git a/tests/sjis-mb b/tests/sjis-mb
new file mode 100644
index 0000000..4454ea1
--- /dev/null
+++ b/tests/sjis-mb
@@ -0,0 +1,50 @@
+#!/bin/sh
+# similar to euc-mb and fgrep-infloop, but tests SJIS encoding.
+# in this encoding, an ASCII character is both a valid single-byte
+# character, and a suffix of a valid double-byte character
+
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ ../src
+
+require_timeout_
+
+# % becomes a half-width katakana in SJIS, and an invalid sequence
+# in UTF-8.  Use this to try skipping implementations that do not
+# support SJIS.
+encode() { echo "$1" | tr @% '\203\301'; }
+
+k=0
+test_grep_reject() {
+  k=$(expr $k + 1)
+  encode "$2" | \
+    LC_ALL=ja_JP.SHIFT_JIS \
+      timeout 10s grep $1 $(encode "$3") > out$k 2>&1
+  test $? = 1
+}
+
+test_grep() {
+  k=$(expr $k + 1)
+  encode "$2" > exp$k
+  LC_ALL=ja_JP.SHIFT_JIS \
+    timeout 10s grep $1 $(encode "$3") exp$k > out$k 2>&1
+  test $? = 0 && compare out$k exp$k
+}
+
+test_grep_reject -F @@ @ || skip_ 'system does not seem to know about SJIS'
+test_grep -F %%AA A || skip_ 'system seems to treat SJIS the same as UTF-8'
+
address@hidden
+successful_tests='%%AA @AA @A@@A'
+
+fail=0
+for i in $successful_tests; do
+  test_grep -F $i A || fail=1
+  test_grep -E $i A || fail=1
+done
+
+for i in $failure_tests; do
+  test_grep_reject -F $i A || fail=1
+  test_grep_reject -E $i A || fail=1
+done
+
+Exit $fail

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

Summary of changes:
 src/kwsearch.c    |   16 +++++++++++-----
 tests/Makefile.am |    1 +
 tests/sjis-mb     |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+), 5 deletions(-)
 create mode 100644 tests/sjis-mb


hooks/post-receive
-- 
grep




reply via email to

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