1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

Merge pull request #6904 from cakebaker/bump_unicode_width

Bump `unicode-width`, adapt test and fixtures
This commit is contained in:
Sylvestre Ledru 2024-12-09 09:40:32 +01:00 committed by GitHub
commit 24ffe4703d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 20 additions and 20 deletions

14
Cargo.lock generated
View file

@ -2743,7 +2743,7 @@ version = "0.0.28"
dependencies = [ dependencies = [
"clap", "clap",
"tempfile", "tempfile",
"unicode-width 0.1.13", "unicode-width 0.2.0",
"uucore", "uucore",
] ]
@ -2806,7 +2806,7 @@ name = "uu_expand"
version = "0.0.28" version = "0.0.28"
dependencies = [ dependencies = [
"clap", "clap",
"unicode-width 0.1.13", "unicode-width 0.2.0",
"uucore", "uucore",
] ]
@ -2848,7 +2848,7 @@ name = "uu_fmt"
version = "0.0.28" version = "0.0.28"
dependencies = [ dependencies = [
"clap", "clap",
"unicode-width 0.1.13", "unicode-width 0.2.0",
"uucore", "uucore",
] ]
@ -3033,7 +3033,7 @@ dependencies = [
"crossterm", "crossterm",
"nix", "nix",
"unicode-segmentation", "unicode-segmentation",
"unicode-width 0.1.13", "unicode-width 0.2.0",
"uucore", "uucore",
] ]
@ -3276,7 +3276,7 @@ dependencies = [
"rayon", "rayon",
"self_cell", "self_cell",
"tempfile", "tempfile",
"unicode-width 0.1.13", "unicode-width 0.2.0",
"uucore", "uucore",
] ]
@ -3468,7 +3468,7 @@ name = "uu_unexpand"
version = "0.0.28" version = "0.0.28"
dependencies = [ dependencies = [
"clap", "clap",
"unicode-width 0.1.13", "unicode-width 0.2.0",
"uucore", "uucore",
] ]
@ -3526,7 +3526,7 @@ dependencies = [
"libc", "libc",
"nix", "nix",
"thiserror 2.0.6", "thiserror 2.0.6",
"unicode-width 0.1.13", "unicode-width 0.2.0",
"uucore", "uucore",
] ]

View file

@ -335,7 +335,7 @@ textwrap = { version = "0.16.1", features = ["terminal_size"] }
thiserror = "2.0.3" thiserror = "2.0.3"
time = { version = "0.3.36" } time = { version = "0.3.36" }
unicode-segmentation = "1.11.0" unicode-segmentation = "1.11.0"
unicode-width = "0.1.12" unicode-width = "0.2.0"
utf-8 = "0.7.6" utf-8 = "0.7.6"
utmp-classic = "0.1.6" utmp-classic = "0.1.6"
walkdir = "2.5" walkdir = "2.5"

View file

@ -700,15 +700,15 @@ mod tests {
test_string.push_str("👩🏻‍🔬"); test_string.push_str("👩🏻‍🔬");
} }
let lines = break_line(&test_string, 80); let lines = break_line(&test_string, 31);
let widths: Vec<usize> = lines let widths: Vec<usize> = lines
.iter() .iter()
.map(|s| UnicodeWidthStr::width(&s[..])) .map(|s| UnicodeWidthStr::width(&s[..]))
.collect(); .collect();
// Each 👩🏻‍🔬 is 6 character width it break line to the closest number to 80 => 6 * 13 = 78 // Each 👩🏻‍🔬 is 2 character width, break line to the closest even number to 31
assert_eq!((78, 42), (widths[0], widths[1])); assert_eq!((30, 10), (widths[0], widths[1]));
} }
#[test] #[test]

View file

@ -11,8 +11,8 @@ ________
_ _
________ ________
👩‍🔬 👩‍🔬 👩‍🔬 👩‍🔬 👩‍🔬 👩‍🔬
__ __
______________ ________
💣💣 💣💣 💣💣 💣💣 💣💣 💣💣
__ __
______________ ______________

View file

@ -15,9 +15,9 @@ ________
___ ___
________ ________
👩‍🔬 👩‍🔬 👩‍🔬 👩‍🔬 👩‍🔬 👩‍🔬
_____ ___
_____ ___
______________ ________
💣💣 💣💣 💣💣 💣💣 💣💣 💣💣
_____ _____
_____ _____

View file

@ -11,8 +11,8 @@ ________
^ no match for key ^ no match for key
________ ________
👩‍🔬 👩‍🔬 👩‍🔬 👩‍🔬 👩‍🔬 👩‍🔬
^ no match for key ^ no match for key
______________ ________
💣💣 💣💣 💣💣 💣💣 💣💣 💣💣
^ no match for key ^ no match for key
______________ ______________

View file

@ -11,8 +11,8 @@ ________
____ ____
________ ________
👩‍🔬 👩‍🔬 👩‍🔬 👩‍🔬 👩‍🔬 👩‍🔬
_______ _____
______________ ________
💣💣 💣💣 💣💣 💣💣 💣💣 💣💣
_______ _______
______________ ______________