10 lines
196 B
Perl
10 lines
196 B
Perl
|
;; Factorial
|
||
|
|
||
|
(defun factorial (n)
|
||
|
(if (> n 1)
|
||
|
(* n (factorial (- n 1)))
|
||
|
1))
|
||
|
|
||
|
(expect "Factorial of 5 is 120" (= (factorial 5) 120))
|
||
|
(expect "Factorial of 1 is 1" (= (factorial 1) 1))
|