From c56e734008e790660faec2db21941ee423412484 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sat, 2 Apr 2022 16:57:02 -0700 Subject: Write a test for case-lambda. I'm realizing that I should have started with builtin-exit and implemented the hard stuff later. --- csc/macros-test.csc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'csc/macros-test.csc') diff --git a/csc/macros-test.csc b/csc/macros-test.csc index 4bdc3f1..23a9cfc 100644 --- a/csc/macros-test.csc +++ b/csc/macros-test.csc @@ -2,13 +2,14 @@ (only (csc ir1) constant-expression constant? + ir1=? lexical-ref-name lexical-ref? lexical-set-expression lexical-set-name lexical-set? make-constant - ir1=? + make-lambda-case void?) (only (csc testing) assert-equal @@ -172,3 +173,14 @@ ((foo x :::) (x :::)))) (foo quote 5)) builtins-environment))) + + +(test builtin-case-lambda + (assert-equal ir1=? + (make-lambda-case '(x y z) #f #f (make-constant 5) + (make-lambda-case '(a b c) 'd #f (make-constant 6) '())) + (expand + '(case-lambda + ((x y z) (quote 5)) + ((a b c . d) (quote 6))) + builtins-environment))) -- cgit v1.3.1