Merge pull request #5397 from sylvestre/ls-42

ls: Document a bit tests/ls/stat-dtype.sh
This commit is contained in:
Daniel Hofstetter 2023-10-13 14:38:31 +02:00 committed by GitHub
commit 617de9b636
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 5 deletions

View file

@ -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},
@ -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);

View file

@ -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");
}