mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
ls: ignore leading period when sorting by name (#2112)
* ls: ignore leading period when sorting by name ls now behaves like GNU ls with respect to sorting files by ignoring leading periods when sorting by main. Added tests to ensure "touch a .a b .b ; ls" returns ".a a .b b" * Replaced clone/collect calls.
This commit is contained in:
parent
c7f9677b77
commit
c3d7358df6
2 changed files with 22 additions and 1 deletions
|
@ -481,6 +481,21 @@ fn test_ls_sort_name() {
|
|||
.arg("--sort=name")
|
||||
.succeeds()
|
||||
.stdout_is(["test-1", "test-2", "test-3\n"].join(sep));
|
||||
|
||||
// Order of a named sort ignores leading dots.
|
||||
let scene_dot = TestScenario::new(util_name!());
|
||||
let at = &scene_dot.fixtures;
|
||||
at.touch(".a");
|
||||
at.touch("a");
|
||||
at.touch(".b");
|
||||
at.touch("b");
|
||||
|
||||
scene_dot
|
||||
.ucmd()
|
||||
.arg("--sort=name")
|
||||
.arg("-A")
|
||||
.succeeds()
|
||||
.stdout_is([".a", "a", ".b", "b\n"].join(sep));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue