add rhai tests
This commit is contained in:
parent
905c4c1f4b
commit
015c1827ef
6 changed files with 18 additions and 1 deletions
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn test_func() {
|
||||||
|
rust_func(entity.index);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
let index = entity.index;
|
||||||
|
|
||||||
|
fn test_func() {
|
||||||
|
rust_func(index);
|
||||||
|
}
|
||||||
3
assets/tests/rhai/pass_entity_from_script.rhai
Normal file
3
assets/tests/rhai/pass_entity_from_script.rhai
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn test_func() {
|
||||||
|
rust_func(entity);
|
||||||
|
}
|
||||||
3
assets/tests/rhai/pass_vec3_from_script.rhai
Normal file
3
assets/tests/rhai/pass_vec3_from_script.rhai
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn test_func() {
|
||||||
|
rust_func(new_vec3(1.5, 2.5, -3.5));
|
||||||
|
}
|
||||||
4
assets/tests/rhai/pass_vec3_to_script.rhai
Normal file
4
assets/tests/rhai/pass_vec3_to_script.rhai
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
fn test_func(vec3) {
|
||||||
|
// TODO: asser vec3 correctness
|
||||||
|
mark_success()
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
$index = $entity.index
|
$index = $entity.index
|
||||||
|
|
||||||
def test_func
|
def test_func
|
||||||
print($index)
|
|
||||||
rust_func($index)
|
rust_func($index)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue