2018-06-13 10:56:29 +02:00
|
|
|
use rhai::Engine;
|
2018-05-23 01:44:41 +02:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_unit() {
|
|
|
|
let mut engine = Engine::new();
|
|
|
|
|
2019-10-09 13:06:32 +02:00
|
|
|
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();
|
|
|
|
|
2019-10-09 13:06:32 +02:00
|
|
|
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();
|
|
|
|
|
2019-10-09 13:06:32 +02:00
|
|
|
assert_eq!(engine.eval::<()>("let x = ( ); x"), Ok(()));
|
2018-06-13 10:56:29 +02:00
|
|
|
}
|