2018-06-13 10:56:29 +02:00
|
|
|
extern crate rhai;
|
|
|
|
|
|
|
|
use rhai::{Engine, EvalAltResult};
|
2017-11-03 17:58:51 +01:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_mismatched_op() {
|
|
|
|
let mut engine = Engine::new();
|
|
|
|
|
2017-12-20 21:09:53 +01:00
|
|
|
assert_eq!(
|
|
|
|
engine.eval::<i64>("60 + \"hello\""),
|
2018-07-16 13:01:11 +02:00
|
|
|
Err(EvalAltResult::ErrorFunctionNotFound("+ (integer,string)".into()))
|
2017-12-20 21:09:53 +01:00
|
|
|
);
|
2017-11-03 17:58:51 +01:00
|
|
|
}
|