diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-06-27 18:09:54 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-06-27 18:09:54 +0000 |
commit | 1539660873718894bb0cfbdff443d3691c32b826 (patch) | |
tree | 4aee31706fc6f051662ff0625add8373ae416121 | |
parent | c3e32a9697498b486465e4b6126f7dc40512b60c (diff) | |
download | glibc-1539660873718894bb0cfbdff443d3691c32b826.tar.gz glibc-1539660873718894bb0cfbdff443d3691c32b826.tar.xz glibc-1539660873718894bb0cfbdff443d3691c32b826.zip |
Update.
* locales/i18n: Backspace isn't blank, tab is. * tst-ctype.c (main): Add tests for control characters and space.
-rw-r--r-- | localedata/ChangeLog | 4 | ||||
-rw-r--r-- | localedata/locales/i18n | 2 | ||||
-rw-r--r-- | localedata/tst-ctype.c | 51 |
3 files changed, 56 insertions, 1 deletions
diff --git a/localedata/ChangeLog b/localedata/ChangeLog index ab99a4e81a..0b7dac9a8a 100644 --- a/localedata/ChangeLog +++ b/localedata/ChangeLog @@ -1,5 +1,9 @@ 2000-06-27 Ulrich Drepper <drepper@redhat.com> + * locales/i18n: Backspace isn't blank, tab is. + + * tst-ctype.c (main): Add tests for control characters and space. + * locales/i18n: Backspace is no space. * locales/i18n: Add \t to space. diff --git a/localedata/locales/i18n b/localedata/locales/i18n index 808e5c4e43..42e2c5edb8 100644 --- a/localedata/locales/i18n +++ b/localedata/locales/i18n @@ -387,7 +387,7 @@ graph / % xdigit <U0030>..<U0039>;<U0041>..<U0046>;<U0061>..<U0066> % -blank <U0008>;<U0020>;<U00A0>;<U2000>..<U2006>;<U2008>..<U200B>;<U3000> +blank <U0009>;<U0020>;<U00A0>;<U2000>..<U2006>;<U2008>..<U200B>;<U3000> % toupper / (<U0061>,<U0041>);(<U0062>,<U0042>);(<U0063>,<U0043>);(<U0064>,<U0044>);/ diff --git a/localedata/tst-ctype.c b/localedata/tst-ctype.c index 729ff6689a..9caee1a43c 100644 --- a/localedata/tst-ctype.c +++ b/localedata/tst-ctype.c @@ -26,6 +26,9 @@ static const char lower[] = "abcdefghijklmnopqrstuvwxyz"; static const char upper[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; static const char digits[] = "0123456789"; +static const char cntrl[] = "\ +\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\ +\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f "; static struct classes @@ -132,6 +135,9 @@ punct = %04x alnum = %04x\n", for (cp = digits; *cp != '\0'; ++cp) if (islower (*cp)) FAIL ("islower ('%c') is true", *cp); + for (cp = cntrl; *cp != '\0'; ++cp) + if (islower (*cp)) + FAIL ("islower ('\\x%02x') is true", *cp); puts (" isupper()"); for (cp = lower; *cp != '\0'; ++cp) @@ -143,6 +149,9 @@ punct = %04x alnum = %04x\n", for (cp = digits; *cp != '\0'; ++cp) if (isupper (*cp)) FAIL ("isupper ('%c') is true", *cp); + for (cp = cntrl; *cp != '\0'; ++cp) + if (isupper (*cp)) + FAIL ("isupper ('\\x%02x') is true", *cp); puts (" isalpha()"); for (cp = lower; *cp != '\0'; ++cp) @@ -154,6 +163,9 @@ punct = %04x alnum = %04x\n", for (cp = digits; *cp != '\0'; ++cp) if (isalpha (*cp)) FAIL ("isalpha ('%c') is true", *cp); + for (cp = cntrl; *cp != '\0'; ++cp) + if (isalpha (*cp)) + FAIL ("isalpha ('\\x%02x') is true", *cp); puts (" isdigit()"); for (cp = lower; *cp != '\0'; ++cp) @@ -165,6 +177,9 @@ punct = %04x alnum = %04x\n", for (cp = digits; *cp != '\0'; ++cp) if (! isdigit (*cp)) FAIL ("isdigit ('%c') not true", *cp); + for (cp = cntrl; *cp != '\0'; ++cp) + if (isdigit (*cp)) + FAIL ("isdigit ('\\x%02x') is true", *cp); puts (" isxdigit()"); for (cp = lower; *cp != '\0'; ++cp) @@ -178,6 +193,9 @@ punct = %04x alnum = %04x\n", for (cp = digits; *cp != '\0'; ++cp) if (! isxdigit (*cp)) FAIL ("isxdigit ('%c') not true", *cp); + for (cp = cntrl; *cp != '\0'; ++cp) + if (isxdigit (*cp)) + FAIL ("isxdigit ('\\x%02x') is true", *cp); puts (" isspace()"); for (cp = lower; *cp != '\0'; ++cp) @@ -189,6 +207,12 @@ punct = %04x alnum = %04x\n", for (cp = digits; *cp != '\0'; ++cp) if (isspace (*cp)) FAIL ("isspace ('%c') is true", *cp); + for (cp = cntrl; *cp != '\0'; ++cp) + if ((isspace (*cp) && ((*cp < '\x09' || *cp > '\x0d') && *cp != ' ')) + || (! isspace (*cp) + && ((*cp >= '\x09' && *cp <= '\x0d') || *cp == ' '))) + FAIL ("isspace ('\\x%02x') %s true", *cp, + (*cp < '\x09' || *cp > '\x0d') ? "is" : "not"); puts (" isprint()"); for (cp = lower; *cp != '\0'; ++cp) @@ -200,6 +224,10 @@ punct = %04x alnum = %04x\n", for (cp = digits; *cp != '\0'; ++cp) if (! isprint (*cp)) FAIL ("isprint ('%c') not true", *cp); + for (cp = cntrl; *cp != '\0'; ++cp) + if ((isprint (*cp) && *cp != ' ') + || (! isprint (*cp) && *cp == ' ')) + FAIL ("isprint ('\\x%02x') is true", *cp); puts (" isgraph()"); for (cp = lower; *cp != '\0'; ++cp) @@ -211,6 +239,9 @@ punct = %04x alnum = %04x\n", for (cp = digits; *cp != '\0'; ++cp) if (! isgraph (*cp)) FAIL ("isgraph ('%c') not true", *cp); + for (cp = cntrl; *cp != '\0'; ++cp) + if (isgraph (*cp)) + FAIL ("isgraph ('\\x%02x') is true", *cp); puts (" isblank()"); for (cp = lower; *cp != '\0'; ++cp) @@ -222,6 +253,10 @@ punct = %04x alnum = %04x\n", for (cp = digits; *cp != '\0'; ++cp) if (isblank (*cp)) FAIL ("isblank ('%c') is true", *cp); + for (cp = cntrl; *cp != '\0'; ++cp) + if ((isblank (*cp) && *cp != '\x09' && *cp != ' ') + || (! isblank (*cp) && (*cp == '\x09' || *cp == ' '))) + FAIL ("isblank ('\\x%02x') %s true", *cp, *cp != '\x09' ? "is" : "not"); puts (" iscntrl()"); for (cp = lower; *cp != '\0'; ++cp) @@ -233,6 +268,10 @@ punct = %04x alnum = %04x\n", for (cp = digits; *cp != '\0'; ++cp) if (iscntrl (*cp)) FAIL ("iscntrl ('%c') is true", *cp); + for (cp = cntrl; *cp != '\0'; ++cp) + if ((iscntrl (*cp) && *cp == ' ') + || (! iscntrl (*cp) && *cp != ' ')) + FAIL ("iscntrl ('\\x%02x') not true", *cp); puts (" ispunct()"); for (cp = lower; *cp != '\0'; ++cp) @@ -244,6 +283,9 @@ punct = %04x alnum = %04x\n", for (cp = digits; *cp != '\0'; ++cp) if (ispunct (*cp)) FAIL ("ispunct ('%c') is true", *cp); + for (cp = cntrl; *cp != '\0'; ++cp) + if (ispunct (*cp)) + FAIL ("ispunct ('\\x%02x') is true", *cp); puts (" isalnum()"); for (cp = lower; *cp != '\0'; ++cp) @@ -255,6 +297,9 @@ punct = %04x alnum = %04x\n", for (cp = digits; *cp != '\0'; ++cp) if (! isalnum (*cp)) FAIL ("isalnum ('%c') not true", *cp); + for (cp = cntrl; *cp != '\0'; ++cp) + if (isalnum (*cp)) + FAIL ("isalnum ('\\x%02x') is true", *cp); puts (" tolower()"); @@ -267,6 +312,9 @@ punct = %04x alnum = %04x\n", for (cp = digits; *cp != '\0'; ++cp) if (tolower (*cp) != *cp) FAIL ("tolower ('%c') != '%c'", *cp, *cp); + for (cp = cntrl; *cp != '\0'; ++cp) + if (tolower (*cp) != *cp) + FAIL ("tolower ('\\x%02x') != '\\x%02x'", *cp, *cp); puts (" toupper()"); for (cp = lower, cp2 = upper; *cp != '\0'; ++cp, ++cp2) @@ -278,6 +326,9 @@ punct = %04x alnum = %04x\n", for (cp = digits; *cp != '\0'; ++cp) if (toupper (*cp) != *cp) FAIL ("toupper ('%c') != '%c'", *cp, *cp); + for (cp = cntrl; *cp != '\0'; ++cp) + if (toupper (*cp) != *cp) + FAIL ("toupper ('\\x%02x') != '\\x%02x'", *cp, *cp); /* Now some locale specific tests. */ |