Commit Graph

21 Commits

Author SHA1 Message Date
2b855d831d Add more Array tests
Added more tests for Array, focusing on methods exposed to gdscript that didn't have tests.
2025-08-30 13:12:16 -04:00
kit
f7c182371e Remove build_array and build_dictionary from tests 2025-05-26 13:02:01 -04:00
692a244713 Test for insertion at array's size 2025-04-15 12:08:54 -04:00
fe39ffeb7d Add negative index to Array.remove_at and Array.insert 2025-04-08 14:55:39 -03:00
75881f8322 Use initializer list in Arrays 2025-03-26 18:38:15 +01:00
f6a35e2a6e Merge pull request #86015 from kitbdev/array-initializer-list
Add list initialization to Array, Variant, and TypedArray
2025-03-19 17:46:06 -05:00
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
89491f4403 Add callable support for find and rfind Array methods 2024-09-13 00:01:53 -07:00
09460d33e6 [Core] Fix sharing of typed arrays from constructor 2024-05-07 09:52:17 +02:00
kit
cb17798df3 Add Array and Variant list inializer 2024-05-02 15:35:17 -04:00
80cb914e06 [Core] Fix incorrect comparison for Array const iterator 2024-04-13 17:32:33 +02:00
64146cb7f3 [Core] Add iteration support to Array 2024-04-10 14:49:34 +02:00
f9826a1dd7 Fix various spelling errors 2024-01-04 09:56:43 -05:00
7752a0d8d1 Fix range error for Array.slice 2023-07-07 23:19:42 +02:00
10f385fb79 Fix Array.slice() rounding for abs(step) != 1 2023-03-14 15:46:45 +01:00
d95794ec8a One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
c6cefb1b79 Array: Relax slice bound checks to properly handle negative indices
The same is done for `Vector` (and thus `Packed*Array`).

`begin` and `end` can now take any value and will be clamped to
`[-size(), size()]`. Negative values are a shorthand for indexing the array
from the last element upward.

`end` is given a default `INT_MAX` value (which will be clamped to `size()`)
so that the `end` parameter can be omitted to go from `begin` to the max size
of the array.

This makes `slice` works similarly to numpy's and JavaScript's.
2022-01-10 22:42:03 +01:00
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
dd30253cdc PackedByteArray, Array slice end exclusive, rename subarray to slice 2021-11-26 22:13:12 -06:00
e078f970db Rename remove() to remove_at() when removing by index 2021-11-23 18:58:57 -07:00
99a282f631 Move and organize tests into subfolders 2021-11-07 00:43:31 -06:00