Auto merge of #9515 - pickfire:patch-1, r=ehuss

Add additional test for CJK progress width

Not clear if CJK test hit boundary, since CJK characters have double width,
if we show an example with an extra single width means one of them hit
character boundary to be able to test ellipsis handling.
This commit is contained in:
bors 2021-06-05 17:21:05 +00:00
commit 1a8692df11

View file

@ -393,6 +393,11 @@ fn test_progress_status() {
format.progress_status(3, 4, ":每個漢字佔據了兩個字元"),
Some("[=============> ] 3/4每個漢字佔據了...".to_string())
);
assert_eq!(
// handle breaking at middle of character
format.progress_status(3, 4, "-每個漢字佔據了兩個字元"),
Some("[=============> ] 3/4-每個漢字佔據了...".to_string())
);
}
#[test]