Skip to content

Commit

Permalink
More test assertions for Random.pop()
Browse files Browse the repository at this point in the history
  • Loading branch information
Xrayez committed Feb 20, 2022
1 parent 3b53bb8 commit 6126c78
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/project/goost/core/math/test_random.gd
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,22 @@ func test_pop():
assert_eq(popped[3], 4)
popped.clear()

array.clear()
for i in 100:
array.push_back(i)

while not array.empty():
var _e = rng.pop(array)

assert_eq(array.size(), 0)

Engine.print_error_messages = false

assert_null(rng.pop([]))
assert_null(rng.pop({}))

Engine.print_error_messages = true


func test_shuffle_array():
var rng = Random.new_instance()
Expand Down

0 comments on commit 6126c78

Please sign in to comment.