X-Git-Url: https://git.lukelau.me/?p=scheme.git;a=blobdiff_plain;f=tests.scm;h=bcd878a11dfccb8368d930931d5ad00721d8c626;hp=2b6e09a4c2c63207707f061f722ca4ca3c377a66;hb=c4a5f8ab1efce20f0e1181ffe34639facb19594a;hpb=86531822ef58c5b29751976f5b41d1c631bdd459 diff --git a/tests.scm b/tests.scm index 2b6e09a..bcd878a 100644 --- a/tests.scm +++ b/tests.scm @@ -61,6 +61,12 @@ (bar . (abs Bool A)) (bar~0 . (abs A Bool)))) +(test (expand-pattern-matches '(let ([(foo x y) (foo 123 234)] [z (f 123)]) x)) + '(let ([x (foo~0 (foo 123 234))] + [y (foo~1 (foo 123 234))] + [z (f 123)]) + x)) + (test-types (typecheck '((lambda (x) (+ ((lambda (y) (x y 3)) 5) 2)))) '(abs (abs Int (abs Int Int)) Int)) @@ -137,14 +143,6 @@ 'Int) - ; pattern matching -(test (let-bindings '(let ([(foo x) a]) x)) - '((x (foo~0 a)))) - -(test (let-bindings '(let ([x (foo 42)] [(foo y) x]) x)) - '((x (foo 42)) - (y (foo~0 x)))) - ; type annotations (test (annotate-types