X-Git-Url: https://git.lukelau.me/?p=scheme.git;a=blobdiff_plain;f=tests.scm;h=d2711d7739ffaa2a671835d9be7f4bf6ed211f0d;hp=f327231339d86e9b0c602f188605b072d57c0cfa;hb=f4b0d5c1b14a1890e1b88398e256b272595346b2;hpb=3d94d4500167a8327473e15cf477727968ee36a2 diff --git a/tests.scm b/tests.scm index f327231..d2711d7 100644 --- a/tests.scm +++ b/tests.scm @@ -312,4 +312,14 @@ (case (bar (foo 42)) [(bar (foo x)) x])) 42) + ; todo: make this error for incomplete pattern match +(test-prog '((data A [foo Int] [bar Int B]) + (data B [baz Int]) + (let ([val (bar 42 (baz 12))]) + (case val + [(foo 42) 0] + [(bar 32 (baz 12)) 1] + [(bar 42 (baz x)) x] + [(foo x) 2]))) + 12)