Factorial test.
Todas las comprobaciones han sido exitosas
The build was successful.

Este commit está contenido en:
2019-02-07 18:29:53 +01:00
padre 6a74bf9e8b
commit 6927c5c038
Se han modificado 2 ficheros con 16 adiciones y 0 borrados

15
tests/factorial_test.aer Archivo normal
Ver fichero

@@ -0,0 +1,15 @@
class Program {
function factorial(int $num) {
if($num == 0 || $num == 1)
return 1;
else
return $num * $this->factorial($num - 1);
}
function main() {
int $num = 7;
print('Factorial of ', $num, ' is ', $this->factorial($num), '.');
}
}

1
tests/factorial_test.exp Archivo normal
Ver fichero

@@ -0,0 +1 @@
Factorial of 7 is 5040.