fix tests

This commit is contained in:
Jaroslaw Konik 2025-05-18 16:27:17 +02:00
parent dceb06133e
commit 765c34c52e
2 changed files with 17 additions and 2 deletions

View file

@ -59,6 +59,12 @@ impl FromLua<'_> for BevyEntity {
#[derive(Debug, Clone, Copy)]
pub struct BevyVec3(pub Vec3);
impl BevyVec3 {
pub fn new(x: f32, y: f32, z: f32) -> Self {
BevyVec3(Vec3 { x, y, z })
}
}
impl UserData for BevyVec3 {}
impl FromLua<'_> for BevyVec3 {

View file

@ -554,6 +554,15 @@ mod rhai_tests {
#[derive(Clone)]
struct BevyEntity(Entity);
#[derive(Clone)]
struct BevyVec3(Vec3);
impl BevyVec3 {
fn new(x: f32, y: f32, z: f32) -> Self {
Self(Vec3 { x, y, z })
}
}
impl AssertStateKeyValue for RhaiRuntime {
type ScriptData = RhaiScriptData;
@ -576,7 +585,7 @@ mod rhai_tests {
}
}
scripting_tests!(RhaiRuntime, "rhai", "rhai", BevyEntity);
scripting_tests!(RhaiRuntime, "rhai", "rhai", BevyEntity, BevyVec3);
}
#[cfg(feature = "lua")]
@ -618,7 +627,7 @@ mod lua_tests {
}
}
scripting_tests!(LuaRuntime, "lua", "lua", BevyEntity);
scripting_tests!(LuaRuntime, "lua", "lua", BevyEntity, BevyVec3);
}
#[cfg(feature = "ruby")]