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

test '(' foo --1 should not panic #4556

Closed
sylvestre opened this issue Mar 19, 2023 · 3 comments · Fixed by #4558
Closed

test '(' foo --1 should not panic #4556

sylvestre opened this issue Mar 19, 2023 · 3 comments · Fixed by #4558
Labels

Comments

@sylvestre
Copy link
Contributor

Working on a fuzzer for test:

$ ./target/debug/coreutils test '(' foo --1
thread 'main' panicked at 'expected ‘)’', src/uu/test/src/parser.rs:145:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

GNU returns:


$ LANG=C /usr/bin/test '(' foo --1
/usr/bin/test: 'foo': binary operator expected

See also:
#4555

@leon3s
Copy link
Contributor

leon3s commented Mar 19, 2023

Hey looking at the code and the commentaries this require to rewrite some function to handle a Result you want a custom ParserError ? or you prefer the use ErrorKind::Custom ?

@sylvestre
Copy link
Contributor Author

I guess custom parser error would be nicer, no ? :)

@leon3s
Copy link
Contributor

leon3s commented Mar 19, 2023

Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants