1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
pub mod unicode;
pub mod collections;
#[cfg(test)]
mod tests {
use super::unicode::CodePoint;
use super::unicode::Ucd;
use super::unicode::props::*;
#[test]
fn code_point_to_string() {
let cp_string = CodePoint::new(0xAC00).unwrap().to_string();
assert_eq!("U+AC00", cp_string);
}
#[test]
fn code_point_gc() {
let cp = CodePoint::new(0xAC00).unwrap();
match cp.gc() {
Gc::Lo => (),
_ => panic!("Not Lo"),
}
}
#[test]
fn code_point_na() {
let c = '🦀';
if c.na() != "CRAB" {
panic!("Not \"CRAB\"");
}
}
}