Skip to content

Commit

Permalink
tests/ls: Add testcase for error paths with width option
Browse files Browse the repository at this point in the history
  • Loading branch information
siebenHeaven committed Apr 18, 2021
1 parent f89cb6d commit b4af0d0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/by-util/test_ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ fn test_ls_width() {
.succeeds()
.stdout_only("test-width-1\ntest-width-2\ntest-width-3\ntest-width-4\n");
}

for option in &["-w 1a", "-w=1a", "--width=1a", "--width 1a"] {
scene
.ucmd()
.args(&option.split(" ").collect::<Vec<_>>())
.fails()
.stderr_only("ls: error: invalid line width: ‘1a’");
}
}

#[test]
Expand Down

0 comments on commit b4af0d0

Please sign in to comment.