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

View file

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

View file

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

View file

@ -12,7 +12,7 @@ ________
________
👩‍🔬 👩‍🔬 👩‍🔬
__
______________
________
💣💣 💣💣 💣💣
__
______________

View file

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

View file

@ -12,7 +12,7 @@ ________
________
👩‍🔬 👩‍🔬 👩‍🔬
^ no match for key
______________
________
💣💣 💣💣 💣💣
^ no match for key
______________

View file

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