Skip to content

Commit

Permalink
Merge pull request uutils#5397 from sylvestre/ls-42
Browse files Browse the repository at this point in the history
ls: Document a bit tests/ls/stat-dtype.sh
  • Loading branch information
cakebaker authored Oct 13, 2023
2 parents 4d3d720 + 41188a9 commit 617de9b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/uu/ls/src/ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

// spell-checker:ignore (ToDO) cpio svgz webm somegroup nlink rmvb xspf tabsize dired subdired
// spell-checker:ignore (ToDO) cpio svgz webm somegroup nlink rmvb xspf tabsize dired subdired dtype

use clap::{
builder::{NonEmptyStringValueParser, ValueParser},
Expand Down Expand Up @@ -2395,10 +2395,10 @@ fn display_grid(
writeln!(out)?;
}
} else {
let mut grid = Grid::new(GridOptions {
filling: Filling::Spaces(2),
direction,
});
// TODO: To match gnu/tests/ls/stat-dtype.sh
// we might want to have Filling::Text("\t".to_string());
let filling = Filling::Spaces(2);
let mut grid = Grid::new(GridOptions { filling, direction });

for name in names {
grid.add(name);
Expand Down
14 changes: 14 additions & 0 deletions tests/by-util/test_ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3678,3 +3678,17 @@ fn test_ls_dired_complex() {
println!("Extracted filenames: {:?}", filenames);
assert_eq!(filenames, vec!["a1", "a22", "a333", "a4444", "d"]);
}

#[ignore = "issue #5396"]
#[test]
fn test_ls_cf_output_should_be_delimited_by_tab() {
let (at, mut ucmd) = at_and_ucmd!();

at.mkdir("e");
at.mkdir("e/a2345");
at.mkdir("e/b");

ucmd.args(&["-CF", "e"])
.succeeds()
.stdout_is("a2345/\tb/\n");
}

0 comments on commit 617de9b

Please sign in to comment.