diff options
author | D.Loh <lploh2016@gmail.com> | 2020-02-07 09:15:08 -0800 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2020-02-07 20:29:58 +0100 |
commit | f123d4eee00323628ae32b1f9b01318402b729fa (patch) | |
tree | 17267d0e75d30e2ef0a179a57bd9c84d1734a6b3 /askama_shared | |
parent | 144ecc5ef9064b3e8e820329f00a84a50e6762eb (diff) | |
download | askama-f123d4eee00323628ae32b1f9b01318402b729fa.tar.gz askama-f123d4eee00323628ae32b1f9b01318402b729fa.tar.bz2 askama-f123d4eee00323628ae32b1f9b01318402b729fa.zip |
add 2 more test
Diffstat (limited to '')
-rw-r--r-- | askama_shared/src/filters/mod.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/askama_shared/src/filters/mod.rs b/askama_shared/src/filters/mod.rs index eeb9e52..bcc70be 100644 --- a/askama_shared/src/filters/mod.rs +++ b/askama_shared/src/filters/mod.rs @@ -358,6 +358,7 @@ mod tests { assert_eq!(truncate(&"您好", &1).unwrap(), "您..."); assert_eq!(truncate(&"您好", &2).unwrap(), "您..."); assert_eq!(truncate(&"您好", &3).unwrap(), "您..."); + assert_eq!(truncate(&"您好", &4).unwrap(), "您好..."); assert_eq!(truncate(&"您好", &6).unwrap(), "您好"); assert_eq!(truncate(&"您好", &7).unwrap(), "您好"); let s = String::from("🤚a🤚"); @@ -367,6 +368,8 @@ mod tests { assert_eq!(truncate(&"🤚a🤚", &2).unwrap(), "🤚..."); assert_eq!(truncate(&"🤚a🤚", &3).unwrap(), "🤚..."); assert_eq!(truncate(&"🤚a🤚", &4).unwrap(), "🤚..."); + assert_eq!(truncate(&"🤚a🤚", &5).unwrap(), "🤚a..."); + assert_eq!(truncate(&"🤚a🤚", &6).unwrap(), "🤚a🤚..."); assert_eq!(truncate(&"🤚a🤚", &9).unwrap(), "🤚a🤚"); assert_eq!(truncate(&"🤚a🤚", &10).unwrap(), "🤚a🤚"); } |