exowos/subject_source/tests/string_utf8.rs
2025-03-15 10:50:05 +01:00

22 lines
364 B
Rust

use subject_source::string::utf8::char_at;
#[test]
pub fn char_at_empty() {
assert_eq!(char_at("", 0), None);
}
#[test]
pub fn char_at_emoji() {
assert_eq!(char_at("🙂🙁", 1), Some('🙁'));
}
#[test]
pub fn char_at_oob() {
assert_eq!(char_at("abc", 3), None);
}
#[test]
pub fn char_at_ascii() {
assert_eq!(char_at("abc", 1), Some('b'));
}