use rhai::{Engine, EvalAltResult}; #[test] fn test_unit() -> Result<(), Box> { let engine = Engine::new(); engine.run("let x = (); x")?; Ok(()) } #[test] fn test_unit_eq() -> Result<(), Box> { let engine = Engine::new(); assert!(engine .eval::("let x = (); let y = (); x == y") .unwrap()); Ok(()) } #[test] fn test_unit_with_spaces() -> Result<(), Box> { let engine = Engine::new(); let _ = engine.run("let x = ( ); x").expect_err("should error"); Ok(()) }