mirror of
https://github.com/openharmony/third_party_rust_unicode-normalization.git
synced 2026-07-19 23:13:33 -04:00
15 lines
416 B
Rust
15 lines
416 B
Rust
use unicode_normalization::{
|
|
is_nfc, is_nfc_stream_safe, UnicodeNormalization,
|
|
};
|
|
|
|
#[test]
|
|
fn test_streamsafe_regression(){
|
|
let input = "\u{342}".repeat(55) + &"\u{344}".repeat(3);
|
|
let nfc_ss = input.chars().nfc().stream_safe().collect::<String>();
|
|
|
|
// The result should be NFC:
|
|
assert!(is_nfc(&nfc_ss));
|
|
// and should be stream-safe:
|
|
assert!(is_nfc_stream_safe(&nfc_ss))
|
|
}
|