1 /* Copyright (c) 2002 Jeff Johnston <jjohnstn@redhat.com> */
2 #include <wctype.h>
3 #include "check.h"
4 
main(void)5 int main(void)
6 {
7   wctype_t x;
8 
9   x = wctype ("alpha");
10   CHECK (x != 0);
11   CHECK (iswctype (L'a', x) && iswalpha (L'a'));
12 
13   x = wctype ("alnum");
14   CHECK (x != 0);
15   CHECK (iswctype (L'0', x) && iswalnum (L'0'));
16 
17   x = wctype ("blank");
18   CHECK (x != 0);
19   CHECK (iswctype (L' ', x) && iswblank (L' '));
20 
21   x = wctype ("cntrl");
22   CHECK (x != 0);
23   CHECK (iswctype (L'\n', x) && iswcntrl (L'\n'));
24 
25   x = wctype ("digit");
26   CHECK (x != 0);
27   CHECK (iswctype (L'7', x) && iswdigit (L'7'));
28 
29   x = wctype ("graph");
30   CHECK (x != 0);
31   CHECK (iswctype (L'!', x) && iswgraph (L'!'));
32 
33   x = wctype ("lower");
34   CHECK (x != 0);
35   CHECK (iswctype (L'k', x) && iswlower (L'k'));
36 
37   x = wctype ("print");
38   CHECK (x != 0);
39   CHECK (iswctype (L'@', x) && iswprint (L'@'));
40 
41   x = wctype ("punct");
42   CHECK (x != 0);
43   CHECK (iswctype (L'.', x) && iswpunct (L'.'));
44 
45   x = wctype ("space");
46   CHECK (x != 0);
47   CHECK (iswctype (L'\t', x) && iswspace (L'\t'));
48 
49   x = wctype ("upper");
50   CHECK (x != 0);
51   CHECK (iswctype (L'T', x) && iswupper (L'T'));
52 
53   x = wctype ("xdigit");
54   CHECK (x != 0);
55   CHECK (iswctype (L'B', x) && iswxdigit (L'B'));
56 
57   x = wctype ("unknown");
58   CHECK (x == 0);
59 
60   exit (0);
61 }
62