diff --git a/tests/bool_op.rs b/tests/bool_op.rs index a7960476..a39001a2 100644 --- a/tests/bool_op.rs +++ b/tests/bool_op.rs @@ -62,39 +62,31 @@ fn test_bool_op_short_circuit() -> Result<(), EvalAltResult> { } #[test] -#[should_panic] fn test_bool_op_no_short_circuit1() { let mut engine = Engine::new(); - assert_eq!( - engine - .eval::( - r" + assert!(engine + .eval::( + r" let this = true; this | { throw; } " - ) - .unwrap(), - false - ); + ) + .is_err()); } #[test] -#[should_panic] fn test_bool_op_no_short_circuit2() { let mut engine = Engine::new(); - assert_eq!( - engine - .eval::( - r" + assert!(engine + .eval::( + r" let this = false; this & { throw; } " - ) - .unwrap(), - false - ); + ) + .is_err()); } diff --git a/tests/var_scope.rs b/tests/var_scope.rs index 0ad6c618..518e3b76 100644 --- a/tests/var_scope.rs +++ b/tests/var_scope.rs @@ -42,7 +42,15 @@ fn test_scope_eval() -> Result<(), EvalAltResult> { println!("result: {}", result); // should print 966 // Variable y is changed in the script - assert_eq!(scope.get_value::("y").unwrap(), 1); + assert_eq!( + scope + .get_value::("y") + .ok_or(EvalAltResult::ErrorRuntime( + "variable y not found".into(), + Default::default() + ))?, + 1 + ); Ok(()) }