Skip to content

Commit b4af0d0

Browse files
committed
tests/ls: Add testcase for error paths with width option
1 parent f89cb6d commit b4af0d0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/by-util/test_ls.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@ fn test_ls_width() {
103103
.succeeds()
104104
.stdout_only("test-width-1\ntest-width-2\ntest-width-3\ntest-width-4\n");
105105
}
106+
107+
for option in &["-w 1a", "-w=1a", "--width=1a", "--width 1a"] {
108+
scene
109+
.ucmd()
110+
.args(&option.split(" ").collect::<Vec<_>>())
111+
.fails()
112+
.stderr_only("ls: error: invalid line width: ‘1a’");
113+
}
106114
}
107115

108116
#[test]

0 commit comments

Comments
 (0)