Skip to content

Commit

Permalink
added recursive sum test
Browse files Browse the repository at this point in the history
  • Loading branch information
michiakig committed Oct 26, 2011
1 parent 1892e88 commit 0565e64
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/incremental/test/procedures.clj
Expand Up @@ -8,4 +8,10 @@
(is (compiled= (letrec ((double (lambda (x) (fx+ x x)))
(triple (lambda (x) (fx+ x (fx+ x x)))))
(app double (app triple 3)))
"18")))
"18"))
(is (compiled= (letrec ((sum (lambda (x)
(if (fx= 0 x)
0
(fx+ x (app sum (fx- x 1)))))))
(app sum 100))
"5050")))

0 comments on commit 0565e64

Please sign in to comment.