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:
Hugo Locurcio 2021-09-15 19:09:34 +02:00
parent 520462e98c
commit c6ca09dc6f
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
30 changed files with 245 additions and 2 deletions

View 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))