|
| 1 | +// Copyright 2015 The Servo Project Developers. |
| 2 | +// Copyright 2017 The UNIC Project Developers. |
| 3 | +// |
| 4 | +// See the COPYRIGHT file at the top-level directory of this distribution. |
| 5 | +// |
| 6 | +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 8 | +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 9 | +// option. This file may not be copied, modified, or distributed |
| 10 | +// except according to those terms. |
| 11 | + |
| 12 | +#![forbid(unsafe_code)] |
| 13 | + |
1 | 14 | extern crate unic; |
2 | 15 |
|
| 16 | + |
3 | 17 | use unic::bidi::BidiInfo; |
4 | 18 | use unic::normal::StrNormalForm; |
| 19 | +use unic::ucd::age::{Age, CharAge}; |
5 | 20 | use unic::ucd::bidi::{BidiClass, BidiChar, BidiStr}; |
6 | 21 | use unic::ucd::normal::compose; |
7 | 22 |
|
8 | 23 | fn main() { |
9 | 24 |
|
| 25 | + // Age |
| 26 | + |
| 27 | + assert_eq!(Age::of('A'), Age::V1_1); |
| 28 | + assert_eq!(Age::of('\u{A0000}'), Age::Unassigned); |
| 29 | + assert_eq!(Age::of('\u{10FFFF}'), Age::V2_0); |
| 30 | + assert_eq!('🦊'.age(), Age::V9_0); |
| 31 | + |
10 | 32 | // Bidi |
11 | 33 |
|
12 | 34 | let text = concat![ |
@@ -55,7 +77,7 @@ fn main() { |
55 | 77 |
|
56 | 78 | // Normalization |
57 | 79 |
|
58 | | - assert_eq!(compose('A', '\u{30a}'), Some('Å')); |
| 80 | + assert_eq!(compose('A', '\u{030A}'), Some('Å')); |
59 | 81 |
|
60 | 82 | let s = "ÅΩ"; |
61 | 83 | let c = s.nfc().collect::<String>(); |
|
0 commit comments