X-Git-Url: https://git.lukelau.me/?a=blobdiff_plain;f=tests.scm;h=bcda209fe2b069bc3778b5f80665877203d067cb;hb=f605bff88ce12e5f4384ab308c036350bfa86cb5;hp=67d8b306140d6502c363fe153227ee4445c6d60e;hpb=4a6161c0db78e4739433377861c0fa89b92619be;p=scheme.git diff --git a/tests.scm b/tests.scm index 67d8b30..bcda209 100644 --- a/tests.scm +++ b/tests.scm @@ -69,6 +69,7 @@ 'int) (test-prog '(+ 1 2) 3) +(test-prog '(bool->int (= 2 0)) 0) (test-prog '((lambda (x) ((lambda (y) (+ x y)) 42)) 100) 142) (test-prog '(* 10 5) 50) @@ -102,3 +103,12 @@ (f f (- n 1) (+ x 1)))))] (inc inc 3 2)) 5) + +(test-prog '(let ([go (lambda (n m x) + (if (= n 0) + x + (go (- n 1) m (* x m))))] + [pow (lambda (p y) (go p y 1))]) + + (pow 3 2)) + 8)