rhai/tests/unit.rs

26 lines
452 B
Rust
Raw Normal View History

use rhai::Engine;
2018-05-23 01:44:41 +02:00
#[test]
fn test_unit() {
let mut engine = Engine::new();
assert_eq!(engine.eval::<()>("let x = (); x"), Ok(()));
2018-05-23 01:44:41 +02:00
}
#[test]
fn test_unit_eq() {
let mut engine = Engine::new();
assert_eq!(
engine.eval::<bool>("let x = (); let y = (); x == y"),
Ok(true)
);
2018-05-23 01:44:41 +02:00
}
#[test]
fn test_unit_with_spaces() {
let mut engine = Engine::new();
assert_eq!(engine.eval::<()>("let x = ( ); x"), Ok(()));
}