rhai/tests/unit.rs
2022-01-10 13:26:33 +08:00

23 lines
512 B
Rust

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