aboutsummaryrefslogtreecommitdiffstats
path: root/csc/macros-test.csc
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-04-02 16:57:02 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-04-02 16:57:02 -0700
commitc56e734008e790660faec2db21941ee423412484 (patch)
treec6d2b7d955525049c2417af20ae8305875cc936f /csc/macros-test.csc
parentImprovements in macros and IR1. (diff)
downloadchromatopelma-c56e734008e790660faec2db21941ee423412484.tar.zst
Write a test for case-lambda.
I'm realizing that I should have started with builtin-exit and implemented the hard stuff later.
Diffstat (limited to 'csc/macros-test.csc')
-rw-r--r--csc/macros-test.csc14
1 files changed, 13 insertions, 1 deletions
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)))