mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
fuzz: set LC_COLLATE=C for expr
This commit is contained in:
parent
7a608196dc
commit
12765a445e
1 changed files with 6 additions and 1 deletions
|
@ -10,7 +10,7 @@ use uu_expr::uumain;
|
||||||
|
|
||||||
use rand::seq::SliceRandom;
|
use rand::seq::SliceRandom;
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
use std::ffi::OsString;
|
use std::{env, ffi::OsString};
|
||||||
|
|
||||||
mod fuzz_common;
|
mod fuzz_common;
|
||||||
use crate::fuzz_common::{generate_and_run_uumain, run_gnu_cmd};
|
use crate::fuzz_common::{generate_and_run_uumain, run_gnu_cmd};
|
||||||
|
@ -86,6 +86,11 @@ fuzz_target!(|_data: &[u8]| {
|
||||||
|
|
||||||
let (rust_output, uumain_exit_code) = generate_and_run_uumain(&args, uumain);
|
let (rust_output, uumain_exit_code) = generate_and_run_uumain(&args, uumain);
|
||||||
|
|
||||||
|
// Use C locale to avoid false positives, like in https://github.com/uutils/coreutils/issues/5378,
|
||||||
|
// because uutils expr doesn't support localization yet
|
||||||
|
// TODO remove once uutils expr supports localization
|
||||||
|
env::set_var("LC_COLLATE", "C");
|
||||||
|
|
||||||
// Run GNU expr with the provided arguments and compare the output
|
// Run GNU expr with the provided arguments and compare the output
|
||||||
match run_gnu_cmd(CMD_PATH, &args[1..], true) {
|
match run_gnu_cmd(CMD_PATH, &args[1..], true) {
|
||||||
Ok((gnu_output, gnu_exit_code)) => {
|
Ok((gnu_output, gnu_exit_code)) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue