diff --git a/tooling/ast_fuzzer/src/compare/compiled.rs b/tooling/ast_fuzzer/src/compare/compiled.rs index 88639cad13a..7f81f3e8bf4 100644 --- a/tooling/ast_fuzzer/src/compare/compiled.rs +++ b/tooling/ast_fuzzer/src/compare/compiled.rs @@ -232,7 +232,11 @@ impl Comparable for InputValue { impl std::fmt::Display for NargoErrorWithTypes { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - std::fmt::Display::fmt(&self.0, f) + if let Some(msg) = self.user_defined_failure_message() { + write!(f, "{}: {}", self.0, msg) + } else { + std::fmt::Display::fmt(&self.0, f) + } } } diff --git a/tooling/ast_fuzzer/src/compare/interpreted.rs b/tooling/ast_fuzzer/src/compare/interpreted.rs index 114f1088fe4..0e62964ffaa 100644 --- a/tooling/ast_fuzzer/src/compare/interpreted.rs +++ b/tooling/ast_fuzzer/src/compare/interpreted.rs @@ -175,7 +175,11 @@ impl Comparable for ssa::interpreter::errors::InterpreterError { BinaryOp::Add { unchecked: false } => msg == "attempt to add with overflow", BinaryOp::Sub { unchecked: false } => msg == "attempt to subtract with overflow", BinaryOp::Mul { unchecked: false } => msg == "attempt to multiply with overflow", - BinaryOp::Shl | BinaryOp::Shr => msg == "attempt to bit-shift with overflow", + BinaryOp::Shl | BinaryOp::Shr => { + msg == "attempt to bit-shift with overflow" + || msg == "attempt to shift right with overflow" + || msg == "attempt to shift left with overflow" + } _ => false, }, ( diff --git a/tooling/ast_fuzzer/src/compare/mod.rs b/tooling/ast_fuzzer/src/compare/mod.rs index 9465b25e1e0..89f64245f41 100644 --- a/tooling/ast_fuzzer/src/compare/mod.rs +++ b/tooling/ast_fuzzer/src/compare/mod.rs @@ -136,11 +136,11 @@ where } CompareResult::LeftFailed(e, _) => { let e = &e.error; - bail!("first program failed: {e}\n{e:?}") + bail!("first program failed: {e}\n\n{e:?}") } CompareResult::RightFailed(_, e) => { let e = &e.error; - bail!("second program failed: {e}\n{e:?}") + bail!("second program failed: {e}\n\n{e:?}") } CompareResult::BothPassed(o1, o2) => match (&o1.return_value, &o2.return_value) { (Some(r1), Some(r2)) if !Comparable::equivalent(r1, r2) => { diff --git a/tooling/ast_fuzzer/src/lib.rs b/tooling/ast_fuzzer/src/lib.rs index fa23f242b21..1166864a6e6 100644 --- a/tooling/ast_fuzzer/src/lib.rs +++ b/tooling/ast_fuzzer/src/lib.rs @@ -103,7 +103,7 @@ impl Default for Config { ("assign", 30), ("if", 10), ("match", 10), - ("for", 25), + ("for", 30), ("let", 25), ("call", 5), ("constrain", 4), @@ -120,7 +120,7 @@ impl Default for Config { ("let", 20), ("call", 5), ("print", 15), - ("constrain", 10), + ("constrain", 15), ]); Self { max_globals: 3,