X-Git-Url: https://git.lukelau.me/?p=scheme.git;a=blobdiff_plain;f=tests.scm;h=f327231339d86e9b0c602f188605b072d57c0cfa;hp=7185032945aab633c43d3fcf0b0f1c24d55d0eb9;hb=54729d061d7cbf50de62d767327fcfc3bea1952f;hpb=e66dabdbc34b1bf5d59cf2596ced19525661a378 diff --git a/tests.scm b/tests.scm index 7185032..f327231 100644 --- a/tests.scm +++ b/tests.scm @@ -295,8 +295,21 @@ (test-prog '((data Foo [a] [b] [c]) (let ([x b]) (case x - [a b] - [b a] - [c x]))) + [a 3] + [b 2] + [c 1]))) 2) +(test-prog '((data Foo [foo Int Int] [bar Bool]) + (case (foo 42 12) + [(foo 20 x) 0] + [(foo 42 x) x] + [(bar x) 0])) + 12) + +(test-prog '((data Foo [foo Int]) + (data Bar [bar Foo]) + (case (bar (foo 42)) + [(bar (foo x)) x])) + 42) +