X-Git-Url: http://git.lukelau.me/?p=scheme.git;a=blobdiff_plain;f=tests.scm;h=7185032945aab633c43d3fcf0b0f1c24d55d0eb9;hp=49fc2c4bc861b13de41f454a7aa2b6e6b103d8d9;hb=e66dabdbc34b1bf5d59cf2596ced19525661a378;hpb=d6b60d54bc90e5ebdc643d05d0b806ae7fd8aa7c diff --git a/tests.scm b/tests.scm index 49fc2c4..7185032 100644 --- a/tests.scm +++ b/tests.scm @@ -169,6 +169,19 @@ y))) 'Int) + ; case statements +(test-types + (typecheck '((data A (foo B)) + (data B (bar Int)) + (case (foo (bar 32)) + [(foo x) x]))) + 'B) + +(test-types + (typecheck '((case 42 + [23 (= 1 2)] + [x (= x 1)]))) + 'Bool) ; type annotations @@ -282,8 +295,8 @@ (test-prog '((data Foo [a] [b] [c]) (let ([x b]) (case x - [a 1] - [b 2] - [c 3]))) + [a b] + [b a] + [c x]))) 2)