diff options
author | Chaosus <chaosus89@gmail.com> | 2024-08-05 22:36:55 +0300 |
---|---|---|
committer | Chaosus <chaosus89@gmail.com> | 2024-11-21 20:24:43 +0300 |
commit | 0524e29b5cf9b4b099e7f2a7be09f21fd80e1e14 (patch) | |
tree | b20999388b756661a38c7627a6ea93416990276c /modules/gdscript/tests/scripts | |
parent | 9e6098432aac35bae42c9089a29ba2a80320d823 (diff) | |
download | redot-engine-0524e29b5cf9b4b099e7f2a7be09f21fd80e1e14.tar.gz |
Fix crash when division by zero/modulo by zero happen on vectors
Diffstat (limited to 'modules/gdscript/tests/scripts')
4 files changed, 18 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/errors/division_by_zero.gd b/modules/gdscript/tests/scripts/runtime/errors/division_by_zero.gd new file mode 100644 index 0000000000..ace5397f40 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/errors/division_by_zero.gd @@ -0,0 +1,3 @@ +func test(): + var integer: int = 1 + integer /= 0 diff --git a/modules/gdscript/tests/scripts/runtime/errors/division_by_zero.out b/modules/gdscript/tests/scripts/runtime/errors/division_by_zero.out new file mode 100644 index 0000000000..6a9d11cd77 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/errors/division_by_zero.out @@ -0,0 +1,6 @@ +GDTEST_RUNTIME_ERROR +>> SCRIPT ERROR +>> on function: test() +>> runtime/errors/division_by_zero.gd +>> 3 +>> Division by zero error in operator '/'. diff --git a/modules/gdscript/tests/scripts/runtime/errors/modulo_by_zero.gd b/modules/gdscript/tests/scripts/runtime/errors/modulo_by_zero.gd new file mode 100644 index 0000000000..99792e4e32 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/errors/modulo_by_zero.gd @@ -0,0 +1,3 @@ +func test(): + var integer: int = 1 + integer %= 0 diff --git a/modules/gdscript/tests/scripts/runtime/errors/modulo_by_zero.out b/modules/gdscript/tests/scripts/runtime/errors/modulo_by_zero.out new file mode 100644 index 0000000000..79c512888f --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/errors/modulo_by_zero.out @@ -0,0 +1,6 @@ +GDTEST_RUNTIME_ERROR +>> SCRIPT ERROR +>> on function: test() +>> runtime/errors/modulo_by_zero.gd +>> 3 +>> Modulo by zero error in operator '%'. |