Add test for string with unicode characters
This commit is contained in:
parent
4e80ae13ec
commit
be0241bab1
1 changed files with 11 additions and 0 deletions
|
@ -276,4 +276,15 @@ mod tests {
|
|||
|
||||
assert_eq!(foo, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_trancate_and_trailoff() {
|
||||
const MAX_CHARS: usize = 24;
|
||||
assert_eq!(
|
||||
truncate_and_trailoff("ajouter un compte d'èèèès", MAX_CHARS),
|
||||
"ajouter un compte d'è…"
|
||||
);
|
||||
assert_eq!(truncate_and_trailoff("ajouter", MAX_CHARS), "ajouter");
|
||||
assert_eq!(truncate_and_trailoff("", MAX_CHARS), "");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue