1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 20:47:46 +00:00

Merge pull request #6162 from BenWiederhake/dev-undo-custom-exit-codes

all: Undo custom exit codes
This commit is contained in:
Sylvestre Ledru 2024-04-25 08:11:41 +02:00 committed by GitHub
commit 4090d468c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 50 additions and 15 deletions

View file

@ -10,3 +10,12 @@ fn test_normal() {
let re = Regex::new(r"^[0-9a-f]{8}").unwrap();
new_ucmd!().succeeds().stdout_matches(&re);
}
#[test]
fn test_invalid_flag() {
new_ucmd!()
.arg("--invalid-argument")
.fails()
.no_stdout()
.code_is(1);
}

View file

@ -43,6 +43,15 @@ fn valid_last_modified_template_vars(from: DateTime<Utc>) -> Vec<Vec<(String, St
.collect()
}
#[test]
fn test_invalid_flag() {
new_ucmd!()
.arg("--invalid-argument")
.fails()
.no_stdout()
.code_is(1);
}
#[test]
fn test_without_any_options() {
let test_file_path = "test_one_page.log";

View file

@ -18,6 +18,22 @@ fn test_invalid_arg() {
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
}
#[test]
fn test_short_help_is_long_help() {
// I can't believe that this test is necessary.
let help_short = new_ucmd!()
.arg("-h")
.succeeds()
.no_stderr()
.stdout_str()
.to_owned();
new_ucmd!()
.arg("--help")
.succeeds()
.no_stderr()
.stdout_is(help_short);
}
#[test]
fn test_tee_processing_multiple_operands() {
// POSIX says: "Processing of at least 13 file operands shall be supported."