Add more integration tests to the GDScript test suite
This also fixes a typo in the `bitwise_float_right_operand.gd` test.
This commit is contained in:
parent
520462e98c
commit
c6ca09dc6f
30 changed files with 245 additions and 2 deletions
19
modules/gdscript/tests/scripts/runtime/features/recursion.gd
Normal file
19
modules/gdscript/tests/scripts/runtime/features/recursion.gd
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
func is_prime(number: int, divisor: int = 2) -> bool:
|
||||
print(divisor)
|
||||
if number <= 2:
|
||||
return (number == 2)
|
||||
elif number % divisor == 0:
|
||||
return false
|
||||
elif divisor * divisor > number:
|
||||
return true
|
||||
|
||||
return is_prime(number, divisor + 1)
|
||||
|
||||
func test():
|
||||
# Not a prime number.
|
||||
print(is_prime(989))
|
||||
|
||||
print()
|
||||
|
||||
# Largest prime number below 10000.
|
||||
print(is_prime(9973))
|
||||
Loading…
Add table
Add a link
Reference in a new issue