lua tests
This commit is contained in:
parent
015c1827ef
commit
b3cd04aad6
6 changed files with 22 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
||||||
|
function test_func()
|
||||||
|
rust_func(entity.index)
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
index = entity.index
|
||||||
|
|
||||||
|
function test_func()
|
||||||
|
rust_func(index)
|
||||||
|
end
|
||||||
3
assets/tests/lua/pass_entity_from_script.lua
Normal file
3
assets/tests/lua/pass_entity_from_script.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
function test_func()
|
||||||
|
rust_func(entity)
|
||||||
|
end
|
||||||
3
assets/tests/lua/pass_vec3_from_script.lua
Normal file
3
assets/tests/lua/pass_vec3_from_script.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
function test_func()
|
||||||
|
rust_func(Vec3(1.5, 2.5, -3.5))
|
||||||
|
end
|
||||||
7
assets/tests/lua/pass_vec3_to_script.lua
Normal file
7
assets/tests/lua/pass_vec3_to_script.lua
Normal 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
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
// TODO: maybe unify api and call non thread methods non_send
|
// TODO: maybe unify api and call non thread methods non_send
|
||||||
// TODO: add tests for entity variable and buitin types for every runtime
|
// TODO: add tests for entity variable and buitin types for every runtime
|
||||||
// TODO: line numbers for errors
|
// TODO: line numbers for errors
|
||||||
|
// TODO: caan rhai have Vec3 constructor instead of vec3_new
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue