diff options
author | Rayhan Faizel <rayhan.faizel@hotmail.com> | 2023-06-06 20:56:42 +0530 |
---|---|---|
committer | Rayhan Faizel <rayhan.faizel@hotmail.com> | 2023-06-06 20:56:42 +0530 |
commit | 21f1a119c3378e9cc17603352c1903a72845d4b2 (patch) | |
tree | 646db4edc03640c9a8ade8494fb60c22984b8d54 /tests/by-util/test_ls.rs | |
parent | 3f33c5b816d5949271a31fee3d9a1e7370fd1baa (diff) |
tests/ls: Implement tests for sort by width option
Diffstat (limited to 'tests/by-util/test_ls.rs')
-rw-r--r-- | tests/by-util/test_ls.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs index 45ced867a..49c2272c0 100644 --- a/tests/by-util/test_ls.rs +++ b/tests/by-util/test_ls.rs @@ -1565,6 +1565,28 @@ fn test_ls_sort_name() { } #[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!()); let at = &scene.fixtures; |