Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tests/by-util/test_cut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ fn test_whitespace_with_char() {
.code_is(1);
}

#[test]
fn test_delimiter_with_byte_and_char() {
for conflicting_arg in ["-c", "-b"] {
new_ucmd!()
.args(&[conflicting_arg, COMPLEX_SEQUENCE.sequence, "-d="])
.fails()
.stderr_is("cut: invalid input: The '--delimiter' ('-d') option only usable if printing a sequence of fields\n")
.code_is(1);
}
}

#[test]
fn test_too_large() {
new_ucmd!()
Expand Down Expand Up @@ -289,6 +300,13 @@ fn test_multiple_mode_args() {
}
}

#[test]
fn test_no_argument() {
new_ucmd!().fails().stderr_is(
"cut: invalid usage: expects one of --fields (-f), --chars (-c) or --bytes (-b)\n",
);
}

#[test]
#[cfg(unix)]
fn test_8bit_non_utf8_delimiter() {
Expand Down