X-Git-Url: https://git.lukelau.me/?a=blobdiff_plain;f=tests.scm;fp=tests.scm;h=67d8b306140d6502c363fe153227ee4445c6d60e;hb=4a6161c0db78e4739433377861c0fa89b92619be;hp=a198dd4ac5a00e4cd71e9a88f8ae32eefbca994c;hpb=2fb532c612fb077a99938b54d59a9520b71772b0;p=scheme.git diff --git a/tests.scm b/tests.scm index a198dd4..67d8b30 100644 --- a/tests.scm +++ b/tests.scm @@ -50,6 +50,24 @@ bar)) '(abs a a)) +(test-types (typecheck '(let ([foo 3] + [bar (+ foo baz)] + [baz (- bar 1)]) + bar)) + 'int) + +(test-types (typecheck '(let ([foo 3] + [bar (baz foo)] + [baz (lambda (x) x)]) + baz)) + '(abs a a)) + +(test-types (typecheck '(let ([foo 3] + [bar (baz foo)] + [baz (lambda (x) x)]) + bar)) + 'int) + (test-prog '(+ 1 2) 3) (test-prog '((lambda (x) ((lambda (y) (+ x y)) 42)) 100) 142)