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

tee: accept shortcuts for stringly-enum arguments

This commit is contained in:
Ben Wiederhake 2024-04-01 08:06:18 +02:00
parent 88a2ea4f3b
commit 25245bde65
2 changed files with 37 additions and 2 deletions

View file

@ -311,6 +311,23 @@ mod linux_only {
expect_correct(file_out_a, &at, content.as_str());
}
#[test]
fn test_pipe_error_warn_nopipe_3_shortcut() {
let (at, mut ucmd) = at_and_ucmd!();
let file_out_a = "tee_file_out_a";
let proc = ucmd
.arg("--output-error=warn-")
.arg(file_out_a)
.set_stdout(make_broken_pipe());
let (content, output) = run_tee(proc);
expect_success(&output);
expect_correct(file_out_a, &at, content.as_str());
}
#[test]
fn test_pipe_error_warn() {
let (at, mut ucmd) = at_and_ucmd!();
@ -362,6 +379,23 @@ mod linux_only {
expect_correct(file_out_a, &at, content.as_str());
}
#[test]
fn test_pipe_error_exit_nopipe_shortcut() {
let (at, mut ucmd) = at_and_ucmd!();
let file_out_a = "tee_file_out_a";
let proc = ucmd
.arg("--output-error=exit-nop")
.arg(file_out_a)
.set_stdout(make_broken_pipe());
let (content, output) = run_tee(proc);
expect_success(&output);
expect_correct(file_out_a, &at, content.as_str());
}
#[test]
fn test_space_error_default() {
let (at, mut ucmd) = at_and_ucmd!();