From d97096bc9f22359b5bca863cd7d26dadc868b33a Mon Sep 17 00:00:00 2001 From: Jaroslaw Konik Date: Wed, 14 May 2025 14:17:12 +0200 Subject: [PATCH] add tests --- assets/tests/ruby/call_script_function_with_params.rb | 7 +++++++ ...ction_gets_called_from_script_with_multiple_params.rb | 2 +- .../rust_function_gets_called_from_script_with_param.rb | 2 +- ...unction_gets_called_from_rust_with_multiple_params.rb | 9 +++++++++ ...t_function_gets_called_from_rust_with_single_param.rb | 4 ++-- 5 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 assets/tests/ruby/call_script_function_with_params.rb create mode 100644 assets/tests/ruby/script_function_gets_called_from_rust_with_multiple_params.rb diff --git a/assets/tests/ruby/call_script_function_with_params.rb b/assets/tests/ruby/call_script_function_with_params.rb new file mode 100644 index 0000000..4c3bfd5 --- /dev/null +++ b/assets/tests/ruby/call_script_function_with_params.rb @@ -0,0 +1,7 @@ +STATE = { + "called_with" => nil +} + +def test_func(x) + called_with = x +end diff --git a/assets/tests/ruby/rust_function_gets_called_from_script_with_multiple_params.rb b/assets/tests/ruby/rust_function_gets_called_from_script_with_multiple_params.rb index 026ad0b..852897c 100644 --- a/assets/tests/ruby/rust_function_gets_called_from_script_with_multiple_params.rb +++ b/assets/tests/ruby/rust_function_gets_called_from_script_with_multiple_params.rb @@ -1,3 +1,3 @@ def test_func - rust_func(5, "test") + rust_func(5, "test") end diff --git a/assets/tests/ruby/rust_function_gets_called_from_script_with_param.rb b/assets/tests/ruby/rust_function_gets_called_from_script_with_param.rb index 5a49c25..3238e08 100644 --- a/assets/tests/ruby/rust_function_gets_called_from_script_with_param.rb +++ b/assets/tests/ruby/rust_function_gets_called_from_script_with_param.rb @@ -1,3 +1,3 @@ def test_func - rust_func(5) + rust_func(5) end diff --git a/assets/tests/ruby/script_function_gets_called_from_rust_with_multiple_params.rb b/assets/tests/ruby/script_function_gets_called_from_rust_with_multiple_params.rb new file mode 100644 index 0000000..8d255b1 --- /dev/null +++ b/assets/tests/ruby/script_function_gets_called_from_rust_with_multiple_params.rb @@ -0,0 +1,9 @@ +STATE = { + 'a_value' => nil, + 'b_value' => nil +} + +def test_func(a, b) + STATE['a_value'] = a + STATE['b_value'] = b +end diff --git a/assets/tests/ruby/script_function_gets_called_from_rust_with_single_param.rb b/assets/tests/ruby/script_function_gets_called_from_rust_with_single_param.rb index a71146d..21b2eb9 100644 --- a/assets/tests/ruby/script_function_gets_called_from_rust_with_single_param.rb +++ b/assets/tests/ruby/script_function_gets_called_from_rust_with_single_param.rb @@ -1,7 +1,7 @@ STATE = { - "a_value" => nil + "a_value" => nil } def test_func(a) - STATE["a_value"] = a + STATE["a_value"] = a end