3 #![feature(const_ascii_ctype_on_intrinsics)]
6 ( $( $fn:ident => [$a:ident, $A:ident, $nine:ident, $dot:ident, $space:ident]; )* ) => {
9 const CHAR_A_LOWER: bool = 'a'.$fn();
10 const CHAR_A_UPPER: bool = 'A'.$fn();
11 const CHAR_NINE: bool = '9'.$fn();
12 const CHAR_DOT: bool = '.'.$fn();
13 const CHAR_SPACE: bool = ' '.$fn();
15 const U8_A_LOWER: bool = b'a'.$fn();
16 const U8_A_UPPER: bool = b'A'.$fn();
17 const U8_NINE: bool = b'9'.$fn();
18 const U8_DOT: bool = b'.'.$fn();
19 const U8_SPACE: bool = b' '.$fn();
22 assert_eq!(CHAR_A_LOWER, $a);
23 assert_eq!(CHAR_A_UPPER, $A);
24 assert_eq!(CHAR_NINE, $nine);
25 assert_eq!(CHAR_DOT, $dot);
26 assert_eq!(CHAR_SPACE, $space);
28 assert_eq!(U8_A_LOWER, $a);
29 assert_eq!(U8_A_UPPER, $A);
30 assert_eq!(U8_NINE, $nine);
31 assert_eq!(U8_DOT, $dot);
32 assert_eq!(U8_SPACE, $space);
44 // 'a' 'A' '9' '.' ' '
45 is_ascii_alphabetic => [true, true, false, false, false];
46 is_ascii_uppercase => [false, true, false, false, false];
47 is_ascii_lowercase => [true, false, false, false, false];
48 is_ascii_alphanumeric => [true, true, true, false, false];
49 is_ascii_digit => [false, false, true, false, false];
50 is_ascii_hexdigit => [true, true, true, false, false];
51 is_ascii_punctuation => [false, false, false, true, false];
52 is_ascii_graphic => [true, true, true, true, false];
53 is_ascii_whitespace => [false, false, false, false, true];
54 is_ascii_control => [false, false, false, false, false];