expr fuzz: add missing ops. found thanks to oss fuzz coverage (#5557)

* expr fuzz: add missing ops. found thanks to oss fuzz coverage
https://storage.googleapis.com/oss-fuzz-coverage/rust-coreutils/reports/20231118/linux/src/rust-coreutils/src/uu/expr/src/syntax_tree.rs.html

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
This commit is contained in:
Sylvestre Ledru 2023-12-20 15:15:20 +01:00 committed by GitHub
parent 6bcf4e2cec
commit ce2a5d5b9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,9 @@ static CMD_PATH: &str = "expr";
fn generate_expr(max_depth: u32) -> String {
let mut rng = rand::thread_rng();
let ops = ["+", "-", "*", "/", "%", "<", ">", "=", "&", "|"];
let ops = [
"+", "-", "*", "/", "%", "<", ">", "=", "&", "|", "!=", "<=", ">=", ":", "index", "length", "substr",
];
let mut expr = String::new();
let mut depth = 0;