Make sure all tests run with all features.

This commit is contained in:
Stephen Chung
2020-03-10 19:48:47 +08:00
parent cc772c6e2a
commit e22aaca5c1
14 changed files with 71 additions and 38 deletions

View File

@@ -1,6 +1,7 @@
use rhai::{Engine, EvalAltResult, RegisterFn};
#[test]
#[cfg(not(feature = "no_stdlib"))]
fn test_mismatched_op() {
let mut engine = Engine::new();
@@ -26,17 +27,13 @@ fn test_mismatched_op_custom_type() {
}
let mut engine = Engine::new();
engine.register_type::<TestStruct>();
engine.register_type_with_name::<TestStruct>("TestStruct");
engine.register_fn("new_ts", TestStruct::new);
let r = engine.eval::<i64>("60 + new_ts()");
match r {
Err(EvalAltResult::ErrorFunctionNotFound(err, _))
if err == "+ (i64, mismatched_op::test_mismatched_op_custom_type::TestStruct)" =>
{
()
}
Err(EvalAltResult::ErrorFunctionNotFound(err, _)) if err == "+ (i64, TestStruct)" => (),
_ => panic!(),
}
}