use super::*;
#[test]
fn truncation_covers_every_multibyte_boundary() {
for (limit, expected) in [
(0, ""),
(1, "a"),
(2, "a"),
(3, "a位"),
(4, "a位"),
(7, "a位馃檪"),
(99, "a位馃檪z"),
] {
let mut value = "a位馃檪z".to_owned();
truncate_utf8(&mut value, limit);
assert_eq!(value, expected);
}
}