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

tests ~ fix tests for new execution_phrase!() and usage phrasing

This commit is contained in:
Roy Ivy III 2021-07-27 00:21:12 -05:00 committed by Michael Debertol
parent c0854000d1
commit 4da46d93c7
11 changed files with 96 additions and 48 deletions

View file

@ -25,15 +25,19 @@ fn test_stdbuf_line_buffered_stdout() {
#[cfg(not(target_os = "windows"))]
#[test]
fn test_stdbuf_no_buffer_option_fails() {
new_ucmd!().args(&["head"]).fails().stderr_is(
let ts = TestScenario::new(util_name!());
ts.ucmd().args(&["head"]).fails().stderr_is(&format!(
"error: The following required arguments were not provided:\n \
--error <MODE>\n \
--input <MODE>\n \
--output <MODE>\n\n\
USAGE:\n \
stdbuf OPTION... COMMAND\n\n\
{1} {0} OPTION... COMMAND\n\n\
For more information try --help",
);
ts.util_name,
ts.bin_path.to_string_lossy()
));
}
#[cfg(not(target_os = "windows"))]
@ -49,9 +53,16 @@ fn test_stdbuf_trailing_var_arg() {
#[cfg(not(target_os = "windows"))]
#[test]
fn test_stdbuf_line_buffering_stdin_fails() {
new_ucmd!().args(&["-i", "L", "head"]).fails().stderr_is(
"stdbuf: line buffering stdin is meaningless\nTry 'stdbuf --help' for more information.",
);
let ts = TestScenario::new(util_name!());
ts.ucmd()
.args(&["-i", "L", "head"])
.fails()
.stderr_is(&format!(
"{0}: line buffering stdin is meaningless\nTry `{1} {0} --help` for more information.",
ts.util_name,
ts.bin_path.to_string_lossy()
));
}
#[cfg(not(target_os = "windows"))]