Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuzz: move the common duplicated code into a function #5332

Merged
merged 2 commits into from
Sep 28, 2023

Conversation

sylvestre
Copy link
Contributor

No description provided.

Comment on lines 31 to 34
static CMD_PATH: &str = "/usr/bin/test";

fn run_gnu_test(args: &[OsString]) -> Result<(String, i32), std::io::Error> {
let mut command = Command::new("test");
let mut command = Command::new(CMD_PATH);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this deliberately done differently than in fuzz_expr.rs? There it is done in the following way:

static CMD_PATH: &str = "expr";

fn run_gnu_expr(args: &[OsString]) -> Result<(String, i32), std::io::Error> {
    is_gnu_cmd(CMD_PATH)?; // Check if it's a GNU implementation

    let mut command = Command::new(CMD_PATH);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/usr/bin/ is an artifact, i will remove it

and yeah, test --version doesn't return anything :(
so, dunno how to verify that it is the GNU impl

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the docs they write to use [:

To get help and version information, invoke the commands ‘[ --help’ and ‘[ --version’

@cakebaker cakebaker merged commit aa0437c into uutils:main Sep 28, 2023
43 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants