diff options
author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-05-06 16:43:04 +0200 |
---|---|---|
committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-05-06 18:03:37 +0200 |
commit | 86de59d60a72e91d135450cccae4e220088a8a4b (patch) | |
tree | acae9333fcc64c6bc6802090ba18a9113e2874ae /tests | |
parent | d8aa2c65a9f857e86d0c1fc1cc6b95b8ccf23099 (diff) | |
download | redot-engine-86de59d60a72e91d135450cccae4e220088a8a4b.tar.gz |
[Core] Add `LocalVector::has` for convenience
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/templates/test_local_vector.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/core/templates/test_local_vector.h b/tests/core/templates/test_local_vector.h index 2873a9a028..c9544c625b 100644 --- a/tests/core/templates/test_local_vector.h +++ b/tests/core/templates/test_local_vector.h @@ -63,7 +63,7 @@ TEST_CASE("[LocalVector] Push Back.") { CHECK(vector[4] == 4); } -TEST_CASE("[LocalVector] Find.") { +TEST_CASE("[LocalVector] Find, has.") { LocalVector<int> vector; vector.push_back(3); vector.push_back(1); @@ -85,6 +85,15 @@ TEST_CASE("[LocalVector] Find.") { CHECK(vector.find(-1) == -1); CHECK(vector.find(5) == -1); + + CHECK(vector.has(0)); + CHECK(vector.has(1)); + CHECK(vector.has(2)); + CHECK(vector.has(3)); + CHECK(vector.has(4)); + + CHECK(!vector.has(-1)); + CHECK(!vector.has(5)); } TEST_CASE("[LocalVector] Remove.") { |