mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
cut: move two tests to better places within file
This commit is contained in:
parent
02eb2c0bab
commit
2f82853bfa
1 changed files with 16 additions and 16 deletions
|
@ -46,6 +46,13 @@ static COMPLEX_SEQUENCE: &TestedSequence = &TestedSequence {
|
||||||
sequence: "9-,6-7,-2,4",
|
sequence: "9-,6-7,-2,4",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[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]
|
#[test]
|
||||||
fn test_invalid_arg() {
|
fn test_invalid_arg() {
|
||||||
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
|
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
|
||||||
|
@ -275,6 +282,15 @@ fn test_equal_as_delimiter3() {
|
||||||
.stdout_only_bytes("abZcd\n");
|
.stdout_only_bytes("abZcd\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_newline_delimited() {
|
||||||
|
new_ucmd!()
|
||||||
|
.args(&["-f", "1", "-d", "\n"])
|
||||||
|
.pipe_in("a:1\nb:")
|
||||||
|
.succeeds()
|
||||||
|
.stdout_only_bytes("a:1\nb:\n");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_multiple() {
|
fn test_multiple() {
|
||||||
let result = new_ucmd!()
|
let result = new_ucmd!()
|
||||||
|
@ -285,15 +301,6 @@ fn test_multiple() {
|
||||||
assert_eq!(result.stderr_str(), "");
|
assert_eq!(result.stderr_str(), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_newline_delimited() {
|
|
||||||
new_ucmd!()
|
|
||||||
.args(&["-f", "1", "-d", "\n"])
|
|
||||||
.pipe_in("a:1\nb:")
|
|
||||||
.succeeds()
|
|
||||||
.stdout_only_bytes("a:1\nb:\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_multiple_mode_args() {
|
fn test_multiple_mode_args() {
|
||||||
for args in [
|
for args in [
|
||||||
|
@ -312,13 +319,6 @@ 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]
|
#[test]
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
fn test_8bit_non_utf8_delimiter() {
|
fn test_8bit_non_utf8_delimiter() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue