mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
truncate: add test_invalid_option
This commit is contained in:
parent
e1f7c774d8
commit
ea5541db56
1 changed files with 16 additions and 3 deletions
|
@ -250,11 +250,24 @@ fn test_size_and_reference() {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_error_filename_only() {
|
fn test_error_filename_only() {
|
||||||
// truncate: you must specify either '--size' or '--reference'
|
// truncate: you must specify either '--size' or '--reference'
|
||||||
new_ucmd!().args(&["file"]).fails().stderr_contains(
|
new_ucmd!()
|
||||||
"error: The following required arguments were not provided:
|
.args(&["file"])
|
||||||
|
.fails()
|
||||||
|
.code_is(1)
|
||||||
|
.stderr_contains(
|
||||||
|
"error: The following required arguments were not provided:
|
||||||
--reference <RFILE>
|
--reference <RFILE>
|
||||||
--size <SIZE>",
|
--size <SIZE>",
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_invalid_option() {
|
||||||
|
// truncate: cli parsing error returns 1
|
||||||
|
new_ucmd!()
|
||||||
|
.args(&["--this-arg-does-not-exist"])
|
||||||
|
.fails()
|
||||||
|
.code_is(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue