1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27: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

@ -2,16 +2,24 @@ use crate::common::util::*;
#[test]
fn test_rejects_nan() {
new_ucmd!().args(&["NaN"]).fails().stderr_only(
"seq: invalid 'not-a-number' argument: 'NaN'\nTry 'seq --help' for more information.",
);
let ts = TestScenario::new(util_name!());
ts.ucmd().args(&["NaN"]).fails().stderr_only(format!(
"{0}: invalid 'not-a-number' argument: 'NaN'\nTry `{1} {0} --help` for more information.",
ts.util_name,
ts.bin_path.to_string_lossy()
));
}
#[test]
fn test_rejects_non_floats() {
new_ucmd!().args(&["foo"]).fails().stderr_only(
"seq: invalid floating point argument: 'foo'\nTry 'seq --help' for more information.",
);
let ts = TestScenario::new(util_name!());
ts.ucmd().args(&["foo"]).fails().stderr_only(&format!(
"{0}: invalid floating point argument: 'foo'\nTry `{1} {0} --help` for more information.",
ts.util_name,
ts.bin_path.to_string_lossy()
));
}
// ---- Tests for the big integer based path ----