Use ? in tests.

This commit is contained in:
Stephen Chung
2023-02-13 08:59:58 +08:00
parent 7da20dd090
commit 7fc72e8c28
9 changed files with 41 additions and 57 deletions

View File

@@ -9,9 +9,7 @@ fn test_float() -> Result<(), Box<EvalAltResult>> {
assert!(engine.eval::<bool>("let x = 0.0; let y = 1.0; x < y")?);
assert!(!engine.eval::<bool>("let x = 0.0; let y = 1.0; x > y")?);
assert!(!engine
.eval::<bool>("let x = 0.; let y = 1.; x > y")
.unwrap());
assert!(!engine.eval::<bool>("let x = 0.; let y = 1.; x > y")?);
assert!((engine.eval::<FLOAT>("let x = 9.9999; x")? - 9.9999 as FLOAT).abs() < EPSILON);
Ok(())