Use ? in tests.
This commit is contained in:
@@ -4,14 +4,12 @@ use rhai::{Engine, EvalAltResult};
|
||||
fn test_not() -> Result<(), Box<EvalAltResult>> {
|
||||
let engine = Engine::new();
|
||||
|
||||
assert!(!engine
|
||||
.eval::<bool>("let not_true = !true; not_true")
|
||||
.unwrap());
|
||||
assert!(!engine.eval::<bool>("let not_true = !true; not_true")?);
|
||||
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
assert!(engine.eval::<bool>("fn not(x) { !x } not(false)").unwrap());
|
||||
assert!(engine.eval::<bool>("fn not(x) { !x } not(false)")?);
|
||||
|
||||
assert!(engine.eval::<bool>("!!!!true").unwrap());
|
||||
assert!(engine.eval::<bool>("!!!!true")?);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user