8000 Add test for streamsafe iterator · unicode-rs/unicode-normalization@a558091 · GitHub
[go: up one dir, main page]

Skip to content

Commit a558091

Browse files
committed
Add test for streamsafe iterator
1 parent 0786dc0 commit a558091

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_streamsafe_regression.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use unicode_normalization::{
2+
char::canonical_combining_class, is_nfc, is_nfc_stream_safe, UnicodeNormalization,
3+
};
4+
5+
#[test]
6+
fn test_streamsafe_regression(){
7+
let input = "\u{342}".repeat(55) + &"\u{344}".repeat(3);
8+
let nfc_ss = input.chars().nfc().stream_safe().collect::<String>();
9+
10+
// The result should be NFC:
11+
assert!(is_nfc(&nfc_ss));
12+
// and should be stream-safe:
13+
assert!(is_nfc_stream_safe(&nfc_ss))
14+
}

0 commit comments

Comments
 (0)
0