diff --git a/Cargo.lock b/Cargo.lock index 62277a370f8..95fe4f11c72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -88,7 +88,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -972,7 +972,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -1681,7 +1681,7 @@ dependencies = [ "portable-atomic", "portable-atomic-util", "serde_core", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -1978,7 +1978,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2562,7 +2562,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2862,7 +2862,7 @@ dependencies = [ "getrandom 0.3.4", "once_cell", "rustix", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4470,9 +4470,9 @@ dependencies = [ [[package]] name = "uutils_term_grid" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcba141ce511bad08e80b43f02976571072e1ff4286f7d628943efbd277c6361" +checksum = "382d49b39de4a115f203305057741126b09a615892d773a2d419a2b816e30e39" dependencies = [ "ansi-width", ] @@ -4600,7 +4600,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index f44d7327c73..c36c3c5b295 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -440,7 +440,7 @@ time = { version = "0.3.36" } unicode-width = "0.2.0" unit-prefix = "0.5" utmp-classic = "0.1.6" -uutils_term_grid = "0.7" +uutils_term_grid = "0.8" walkdir = "2.5" winapi-util = "0.1.8" windows-sys = { version = "0.61.0", default-features = false } diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs index 11365392ae1..0f5bf084d50 100644 --- a/tests/by-util/test_ls.rs +++ b/tests/by-util/test_ls.rs @@ -950,6 +950,44 @@ fn test_ls_across() { } } +#[test] +fn test_ls_across_single_row() { + // Regression test: uutils_term_grid had an off-by-one bug where the column-search + // loop used `..cells.len()` (exclusive) instead of `..=cells.len()` (inclusive), + // preventing it from ever trying to fit all items on one row. + // See: https://github.com/uutils/uutils-term-grid/pull/57 + // https://github.com/eza-community/eza/issues/1738 + let scene = TestScenario::new(util_name!()); + let at = &scene.fixtures; + for name in &[ + "code", + "Desktop", + "Documents", + "Downloads", + "Music", + "Pictures", + "Public", + "Templates", + "Videos", + ] { + at.touch(name); + } + + // With width=96 and LC_ALL=C sort order all 9 entries (79 chars total) fit on one line. + // GNU ls produces: "Desktop Documents Downloads Music Pictures Public Templates Videos code" + for option in ACROSS_ARGS { + scene + .ucmd() + .env("LC_ALL", "C") + .arg(option) + .arg("--width=96") + .succeeds() + .stdout_only( + "Desktop\t Documents Downloads Music Pictures\tPublic\tTemplates Videos code\n", + ); + } +} + #[test] fn test_ls_commas() { let scene = TestScenario::new(util_name!());