Skip to content

Commit

Permalink
Auto merge of #9515 - pickfire:patch-1, r=ehuss
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Jun 5, 2021
2 parents 71c1760 + 4d82360 commit 1a8692d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cargo/util/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 1a8692d

Please sign in to comment.