1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

comm: implement --zero-terminated

This commit is contained in:
Daniel Hofstetter 2023-02-28 10:57:14 +01:00
parent f5a9ffe52f
commit 0d782e09c1
6 changed files with 93 additions and 37 deletions

View file

@ -95,19 +95,23 @@ fn output_delimiter_nul() {
.stdout_only_fixture("ab_delimiter_nul.expected");
}
// even though (info) documentation suggests this is an option
// in latest GNU Coreutils comm, it actually is not.
// this test is essentially an alarm in case some well-intending
// developer implements it.
//marked as unimplemented as error message not set yet.
#[cfg_attr(not(feature = "test_unimplemented"), ignore)]
#[test]
fn zero_terminated() {
for param in ["-z", "--zero-terminated"] {
new_ucmd!()
.args(&[param, "a", "b"])
.fails()
.stderr_only("error to be defined");
.args(&[param, "a_nul", "b_nul"])
.succeeds()
.stdout_only_fixture("ab_nul.expected");
}
}
#[test]
fn zero_terminated_with_total() {
for param in ["-z", "--zero-terminated"] {
new_ucmd!()
.args(&[param, "--total", "a_nul", "b_nul"])
.succeeds()
.stdout_only_fixture("ab_nul_total.expected");
}
}