Make sure all tests run with all features.
This commit is contained in:
@@ -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!(),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user