Allow sync in test.

This commit is contained in:
Stephen Chung 2021-04-03 12:10:08 +08:00
parent b1452f4c35
commit ab0ea87f9c

View File

@ -2,7 +2,6 @@
use rhai::{Engine, EvalAltResult, FnNamespace, Module, ParseErrorType, Shared, INT};
#[cfg(not(feature = "no_object"))]
#[cfg(not(feature = "sync"))]
#[test]
fn test_functions_trait_object() -> Result<(), Box<EvalAltResult>> {
trait TestTrait {
@ -18,8 +17,12 @@ fn test_functions_trait_object() -> Result<(), Box<EvalAltResult>> {
}
}
#[cfg(not(feature = "sync"))]
type MySharedTestTrait = Shared<dyn TestTrait>;
#[cfg(feature = "sync")]
type MySharedTestTrait = Shared<dyn TestTrait + Send + Sync>;
let mut engine = Engine::new();
engine