lua tests

This commit is contained in:
Jaroslaw Konik 2025-05-18 17:18:52 +02:00
parent 015c1827ef
commit b3cd04aad6
6 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,3 @@
function test_func()
rust_func(entity.index)
end

View file

@ -0,0 +1,5 @@
index = entity.index
function test_func()
rust_func(index)
end

View file

@ -0,0 +1,3 @@
function test_func()
rust_func(entity)
end

View file

@ -0,0 +1,3 @@
function test_func()
rust_func(Vec3(1.5, 2.5, -3.5))
end

View file

@ -0,0 +1,7 @@
function test_func(vec3)
-- raise unless vec3.is_a?(Vec3) # TODO: BevyScriptum::Vec3 and add example how to include it globally like Sinatra does
-- raise unless vec3.x == 1.5
-- raise unless vec3.y == 2.5
-- raise unless vec3.z == -3.5
mark_success()
end

View file

@ -4,6 +4,7 @@
// TODO: maybe unify api and call non thread methods non_send
// TODO: add tests for entity variable and buitin types for every runtime
// TODO: line numbers for errors
// TODO: caan rhai have Vec3 constructor instead of vec3_new
use std::{
collections::HashMap,