From 46d5d638fe448b06a1b10c275ebf82889f34cd0d Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Mon, 2 Dec 2024 15:03:28 +0100 Subject: [PATCH 1/3] Bump unicode-width from 0.1.12 to 0.2.0 --- Cargo.lock | 14 +++++++------- Cargo.toml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed82e9aa7..0a07c7398 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", ] diff --git a/Cargo.toml b/Cargo.toml index caa233802..a4f8462e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" From ec67d22123bf254c138585f52856e06464487d48 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Mon, 2 Dec 2024 16:04:24 +0100 Subject: [PATCH 2/3] more: adapt test to change in unicode-width --- src/uu/more/src/more.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/uu/more/src/more.rs b/src/uu/more/src/more.rs index cb74e1176..61d9b2adb 100644 --- a/src/uu/more/src/more.rs +++ b/src/uu/more/src/more.rs @@ -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 = 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] From 2a406d8cbb5ba52bc0c3f7459dddeb5b6540cc6f Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Wed, 4 Dec 2024 14:56:02 +0100 Subject: [PATCH 3/3] sort: adapt fixtures to change in unicode-width --- tests/fixtures/sort/keys_closed_range.expected.debug | 4 ++-- tests/fixtures/sort/keys_multiple_ranges.expected.debug | 6 +++--- tests/fixtures/sort/keys_no_field_match.expected.debug | 4 ++-- tests/fixtures/sort/keys_open_ended.expected.debug | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/fixtures/sort/keys_closed_range.expected.debug b/tests/fixtures/sort/keys_closed_range.expected.debug index b78db4af1..e317d4079 100644 --- a/tests/fixtures/sort/keys_closed_range.expected.debug +++ b/tests/fixtures/sort/keys_closed_range.expected.debug @@ -11,8 +11,8 @@ ________ _ ________ 👩‍🔬 👩‍🔬 👩‍🔬 - __ -______________ + __ +________ 💣💣 💣💣 💣💣 __ ______________ diff --git a/tests/fixtures/sort/keys_multiple_ranges.expected.debug b/tests/fixtures/sort/keys_multiple_ranges.expected.debug index 830e9afd0..41b7e210d 100644 --- a/tests/fixtures/sort/keys_multiple_ranges.expected.debug +++ b/tests/fixtures/sort/keys_multiple_ranges.expected.debug @@ -15,9 +15,9 @@ ________ ___ ________ 👩‍🔬 👩‍🔬 👩‍🔬 - _____ - _____ -______________ + ___ + ___ +________ 💣💣 💣💣 💣💣 _____ _____ diff --git a/tests/fixtures/sort/keys_no_field_match.expected.debug b/tests/fixtures/sort/keys_no_field_match.expected.debug index 60197b1de..0a3ea8303 100644 --- a/tests/fixtures/sort/keys_no_field_match.expected.debug +++ b/tests/fixtures/sort/keys_no_field_match.expected.debug @@ -11,8 +11,8 @@ ________ ^ no match for key ________ 👩‍🔬 👩‍🔬 👩‍🔬 - ^ no match for key -______________ + ^ no match for key +________ 💣💣 💣💣 💣💣 ^ no match for key ______________ diff --git a/tests/fixtures/sort/keys_open_ended.expected.debug b/tests/fixtures/sort/keys_open_ended.expected.debug index d3a56ffd6..c8e4ad9ae 100644 --- a/tests/fixtures/sort/keys_open_ended.expected.debug +++ b/tests/fixtures/sort/keys_open_ended.expected.debug @@ -11,8 +11,8 @@ ________ ____ ________ 👩‍🔬 👩‍🔬 👩‍🔬 - _______ -______________ + _____ +________ 💣💣 💣💣 💣💣 _______ ______________