tests/ls: Implement tests for sort by width option

This commit is contained in:
Rayhan Faizel 2023-06-06 20:56:42 +05:30
parent 3f33c5b816
commit 21f1a119c3

View file

@ -1564,6 +1564,28 @@ fn test_ls_sort_name() {
.stdout_is(".a\n.b\na\nb\n");
}
#[test]
fn test_ls_sort_width() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
at.touch("aaaaa");
at.touch("bbb");
at.touch("cccc");
at.touch("eee");
at.touch("d");
at.touch("fffff");
at.touch("abc");
at.touch("zz");
at.touch("bcdef");
scene
.ucmd()
.arg("--sort=width")
.succeeds()
.stdout_is("d\nzz\nabc\nbbb\neee\ncccc\naaaaa\nbcdef\nfffff\n");
}
#[test]
fn test_ls_order_size() {
let scene = TestScenario::new(util_name!());