@@ -84,7 +84,7 @@ fuzz_target!(|_data: &[u8]| {
8484 let mut args = vec![ OsString :: from( "expr" ) ] ;
8585 args. extend( expr. split_whitespace( ) . map( OsString :: from) ) ;
8686
87- let ( rust_output, uumain_exit_code) = generate_and_run_uumain( & mut args, uumain) ;
87+ let ( rust_output, uumain_exit_code) = generate_and_run_uumain( & args, uumain) ;
8888
8989 // Run GNU expr with the provided arguments and compare the output
9090 match run_gnu_cmd( CMD_PATH , & args[ 1 ..] , true ) {
@@ -96,16 +96,16 @@ fuzz_target!(|_data: &[u8]| {
9696 println!( "GNU code: {}" , gnu_exit_code) ;
9797 panic!( "Different error codes" ) ;
9898 }
99- if rust_output != gnu_output {
100- println!( "Expression: {}" , expr) ;
101- println!( "Rust output: {}" , rust_output) ;
102- println!( "GNU output: {}" , gnu_output) ;
103- panic!( "Different output between Rust & GNU" ) ;
104- } else {
99+ if rust_output == gnu_output {
105100 println!(
106101 "Outputs matched for expression: {} => Result: {}" ,
107102 expr, rust_output
108103 ) ;
104+ } else {
105+ println!( "Expression: {}" , expr) ;
106+ println!( "Rust output: {}" , rust_output) ;
107+ println!( "GNU output: {}" , gnu_output) ;
108+ panic!( "Different output between Rust & GNU" ) ;
109109 }
110110 }
111111 Err ( _) => {
0 commit comments