grep-commit
[Top][All Lists]
Advanced

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

Changes to grep/tests/foad1.sh


From: Charles Levert
Subject: Changes to grep/tests/foad1.sh
Date: Wed, 15 Jun 2005 14:55:30 -0400

Index: grep/tests/foad1.sh
diff -u grep/tests/foad1.sh:1.8 grep/tests/foad1.sh:1.9
--- grep/tests/foad1.sh:1.8     Tue Jun 14 20:56:42 2005
+++ grep/tests/foad1.sh Wed Jun 15 18:55:28 2005
@@ -82,62 +82,65 @@
 grep_test "LIN7C 55327/" "" -wF -e 5327 -e 5532
 
 
-u=cs_CZ.UTF-8
+# The rest of this file is meant to be executed under this locale.
+LC_ALL=cs_CZ.UTF-8; export LC_ALL
 # If the UTF-8 locale doesn't work, skip these tests silently.
-if LC_ALL="$u" locale -k LC_CTYPE 2>/dev/null |
-  "${GREP}" -q "charmap.*UTF-8"
-then
-  # Test character class erroneously matching a '[' character.
-  LC_ALL="$u" grep_test "[/" "" "[[:alpha:]]" -E
-
-  for mode in F G E; do
-    # Hint:  pipe the output of these tests in
-    #        "| LESS= LESSCHARSET=ascii less".
-    # LETTER N WITH TILDE is U+00F1 and U+00D1.
-    # LETTER Y WITH DIAERESIS is U+00FF and U+0178.
-    LC_ALL="$u" grep_test 'añÿb/AÑŸB/' 'ñÿ/ÑŸ/' 'ñÿ' -o -i -$mode
-    LC_ALL="$u" grep_test 'añÿb/AÑŸB/' 'ñÿ/ÑŸ/' 'ÑŸ' -o -i -$mode
-    LC_ALL="$u" grep_test 'añÿb/AÑŸB/' 
"a${CB}ñÿ${CE}b/A${CB}ÑŸ${CE}B/" 'ñÿ' --color=always -i -$mode
-    LC_ALL="$u" grep_test 'añÿb/AÑŸB/' 
"a${CB}ñÿ${CE}b/A${CB}ÑŸ${CE}B/" 'ÑŸ' --color=always -i -$mode
-
-    # POSIX (about -i):  ... each character in the string is matched
-    # against the pattern, not only the character, but also its case
-    # counterpart (if any), shall be matched.
-    # The following were chosen because of their trickiness due to the
-    # differing UTF-8 octet length of their counterpart and to the
-    # non-reflexivity of their mapping.
-    # Beware of homographs!  Look carefully at the actual octets.
-
-    # lc(U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE) = U+0069 LATIN SMALL 
LETTER I
-    LC_ALL="$u" grep_test 'aÄ°b/' "a${CB}Ä°${CE}b/" 'i' --color=always -i 
-$mode
-    LC_ALL="$u" grep_test 'aib/' ''               'Ä°' --color=always -i -$mode
-    LC_ALL="$u" grep_test 'aÄ°b/' ''               'I' --color=always -i -$mode
-    # uc(U+0131 LATIN SMALL LETTER DOTLESS I)          = U+0049 LATIN CAPITAL 
LETTER I
-    LC_ALL="$u" grep_test 'aıb/' "a${CB}ı${CE}b/" 'I' --color=always -i 
-$mode
-    LC_ALL="$u" grep_test 'aIb/' ''               'ı' --color=always -i -$mode
-    LC_ALL="$u" grep_test 'aıb/' ''               'i' --color=always -i -$mode
-    # uc(U+017F LATIN SMALL LETTER LONG S)             = U+0053 LATIN CAPITAL 
LETTER S
-    LC_ALL="$u" grep_test 'aſb/' "a${CB}ſ${CE}b/" 'S' --color=always -i 
-$mode
-    LC_ALL="$u" grep_test 'aSb/' ''               'Å¿' --color=always -i -$mode
-    LC_ALL="$u" grep_test 'aſb/' ''               's' --color=always -i -$mode
-    # uc(U+1FBE GREEK PROSGEGRAMMENI)                  = U+0399 GREEK CAPITAL 
LETTER IOTA
-    LC_ALL="$u" grep_test 'aιb/' "a${CB}ι${CE}b/" 'Ι' --color=always -i 
-$mode
-    LC_ALL="$u" grep_test 'aΙb/' ''               'ι' --color=always -i 
-$mode
-    LC_ALL="$u" grep_test 'aιb/' ''               'ι' --color=always -i 
-$mode
-    # lc(U+2126 OHM SIGN)                              = U+03C9 GREEK SMALL 
LETTER OMEGA
-    LC_ALL="$u" grep_test 'aΩb/' "a${CB}Ω${CE}b/" 'ω' --color=always -i 
-$mode
-    LC_ALL="$u" grep_test 'aωb/' ''               'Ω' --color=always -i 
-$mode
-    LC_ALL="$u" grep_test 'aΩb/' ''               'Ω' --color=always -i 
-$mode
-    # lc(U+212A KELVIN SIGN)                           = U+006B LATIN SMALL 
LETTER K
-    LC_ALL="$u" grep_test 'aKb/' "a${CB}K${CE}b/" 'k' --color=always -i 
-$mode
-    LC_ALL="$u" grep_test 'akb/' ''               'K' --color=always -i 
-$mode
-    LC_ALL="$u" grep_test 'aKb/' ''               'K' --color=always -i 
-$mode
-    # lc(U+212B ANGSTROM SIGN)                         = U+00E5 LATIN SMALL 
LETTER A WITH RING ABOVE
-    LC_ALL="$u" grep_test 'aÅb/' "a${CB}Å${CE}b/" 'å' --color=always -i 
-$mode
-    LC_ALL="$u" grep_test 'aåb/' ''               'Å' --color=always -i 
-$mode
-    LC_ALL="$u" grep_test 'aÅb/' ''               'Å' --color=always -i 
-$mode
-  done
-fi
+locale -k LC_CTYPE 2>/dev/null | "${GREP}" -q "charmap.*UTF-8" || exit 
$failures
 
+# Test character class erroneously matching a '[' character.
+grep_test "[/" "" "[[:alpha:]]" -E
+
+for mode in F G E; do
+  # Hint:  pipe the output of these tests in
+  #        "| LESS= LESSCHARSET=ascii less".
+  # LETTER N WITH TILDE is U+00F1 and U+00D1.
+  # LETTER Y WITH DIAERESIS is U+00FF and U+0178.
+  grep_test 'añÿb/AÑŸB/' 'ñÿ/ÑŸ/' 'ñÿ' -o -i -$mode
+  grep_test 'añÿb/AÑŸB/' 'ñÿ/ÑŸ/' 'ÑŸ' -o -i -$mode
+  grep_test 'añÿb/AÑŸB/' "a${CB}ñÿ${CE}b/A${CB}ÑŸ${CE}B/" 'ñÿ' 
--color=always -i -$mode
+  grep_test 'añÿb/AÑŸB/' "a${CB}ñÿ${CE}b/A${CB}ÑŸ${CE}B/" 'ÑŸ' 
--color=always -i -$mode
+
+  # POSIX (about -i):  ... each character in the string is matched
+  # against the pattern, not only the character, but also its case
+  # counterpart (if any), shall be matched.
+  # The following were chosen because of their trickiness due to the
+  # differing UTF-8 octet length of their counterpart and to the
+  # non-reflexivity of their mapping.
+  # Beware of homographs!  Look carefully at the actual octets.
+
+  # lc(U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE) = U+0069 LATIN SMALL 
LETTER I
+  grep_test 'aÄ°b/' "a${CB}Ä°${CE}b/" 'i' --color=always -i -$mode
+  grep_test 'aib/' ''               'Ä°' --color=always -i -$mode
+  grep_test 'aÄ°b/' ''               'I' --color=always -i -$mode
+  # uc(U+0131 LATIN SMALL LETTER DOTLESS I)          = U+0049 LATIN CAPITAL 
LETTER I
+  grep_test 'aıb/' "a${CB}ı${CE}b/" 'I' --color=always -i -$mode
+  grep_test 'aIb/' ''               'ı' --color=always -i -$mode
+  grep_test 'aıb/' ''               'i' --color=always -i -$mode
+  # uc(U+017F LATIN SMALL LETTER LONG S)             = U+0053 LATIN CAPITAL 
LETTER S
+  grep_test 'aſb/' "a${CB}ſ${CE}b/" 'S' --color=always -i -$mode
+  grep_test 'aSb/' ''               'Å¿' --color=always -i -$mode
+  grep_test 'aſb/' ''               's' --color=always -i -$mode
+  # uc(U+1FBE GREEK PROSGEGRAMMENI)                  = U+0399 GREEK CAPITAL 
LETTER IOTA
+  grep_test 'aιb/' "a${CB}ι${CE}b/" 'Ι' --color=always -i -$mode
+  grep_test 'aΙb/' ''               'ι' --color=always -i -$mode
+  grep_test 'aιb/' ''               'ι' --color=always -i -$mode
+  # lc(U+2126 OHM SIGN)                              = U+03C9 GREEK SMALL 
LETTER OMEGA
+  grep_test 'aΩb/' "a${CB}Ω${CE}b/" 'ω' --color=always -i -$mode
+  grep_test 'aωb/' ''               'Ω' --color=always -i -$mode
+  grep_test 'aΩb/' ''               'Ω' --color=always -i -$mode
+  # lc(U+212A KELVIN SIGN)                           = U+006B LATIN SMALL 
LETTER K
+  grep_test 'aKb/' "a${CB}K${CE}b/" 'k' --color=always -i -$mode
+  grep_test 'akb/' ''               'K' --color=always -i -$mode
+  grep_test 'aKb/' ''               'K' --color=always -i -$mode
+  # lc(U+212B ANGSTROM SIGN)                         = U+00E5 LATIN SMALL 
LETTER A WITH RING ABOVE
+  grep_test 'aÅb/' "a${CB}Å${CE}b/" 'å' --color=always -i -$mode
+  grep_test 'aåb/' ''               'Å' --color=always -i -$mode
+  grep_test 'aÅb/' ''               'Å' --color=always -i -$mode
+done
+
+
+# Any tests inserted right here will be performed under an UTF-8 locale.
+# Insert them before LC_ALL is set above to avoid this.
+# Leave this comment last.
 
 exit $failures




reply via email to

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