Skip to content

Commit

Permalink
tests/ls: Implement tests for sort by width option
Browse files Browse the repository at this point in the history
  • Loading branch information
Skryptonyte committed Jun 6, 2023
1 parent 3f33c5b commit 21f1a11
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/by-util/test_ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!());
Expand Down

0 comments on commit 21f1a11

Please sign in to comment.