Add more Array tests

Added more tests for Array, focusing on methods exposed to gdscript that didn't have tests.
This commit is contained in:
aaronp64
2025-08-29 16:18:20 -04:00
parent cb850f7719
commit 2b855d831d
3 changed files with 160 additions and 9 deletions

View File

@ -0,0 +1,5 @@
func test():
var array := [1, 2, 3]
array.set(4, 4)
var _value = array.get(4)
_value = array[4]

View File

@ -0,0 +1,4 @@
GDTEST_RUNTIME_ERROR
>> ERROR: Index p_index = 4 is out of bounds (p_instance->size() = 3).
>> ERROR: Index p_index = 4 is out of bounds (p_instance->size() = 3).
>> SCRIPT ERROR at runtime/errors/array_bad_index.gd:5 on test(): Out of bounds get index '4' (on base: 'Array')