Fix openFile003 for Win64
[packages/base.git] / tests / unicode001.hs
1 -- !!! Tests the various character classifiactions for a selection of Unicode
2 -- characters.
3
4 module Main where
5
6 import Data.Char
7
8 main = do
9 putStrLn (" " ++ concat (map (++" ") strs))
10 mapM putStrLn (map do_char chars)
11 where
12 do_char char = s ++ (take (12-length s) (repeat ' ')) ++ concat (map f bs)
13 where
14 s = show char
15 bs = map ($char) functions
16 f True = "X "
17 f False = " "
18
19 strs = ["upper","lower","alpha","alnum","digit","print","space","cntrl"]
20
21 functions = [isUpper,isLower,isAlpha,isAlphaNum,isDigit,isPrint,isSpace,isControl]
22
23 chars = [backspace,tab,space,zero,lower_a,upper_a,delete,
24 right_pointing_double_angle_quotation_mark,
25 greek_capital_letter_alpha,
26 bengali_digit_zero,
27 en_space,
28 gothic_letter_ahsa,
29 monospaced_digit_zero
30 ]
31
32 backspace = '\x08'
33 tab = '\t'
34 space = ' '
35 zero = '0'
36 lower_a = 'a'
37 upper_a = 'A'
38 delete = '\x7f'
39 right_pointing_double_angle_quotation_mark = '\xBB'
40 latin_small_letter_i_with_caron = '\x1D0'
41 combining_acute_accent = '\x301'
42 greek_capital_letter_alpha = '\x0391'
43 bengali_digit_zero = '\x09E6'
44 en_space = '\x2002'
45 gothic_letter_ahsa = '\x10330'
46 monospaced_digit_zero = '\x1D7F6'