aboutsummaryrefslogtreecommitdiffstats
path: root/csc/macros-test.csc
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-04-07 19:32:07 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-04-07 19:32:07 -0700
commitb94b0450645a3739c26e5bc99bfeba3304eb95c4 (patch)
treece98014fa57f62cf769f26577408307b1aedd008 /csc/macros-test.csc
parentWrite a test for case-lambda. (diff)
downloadchromatopelma-b94b0450645a3739c26e5bc99bfeba3304eb95c4.tar.zst
Add libraries.
Gone is toplevel. Now everyone lives in a library.
Diffstat (limited to 'csc/macros-test.csc')
-rw-r--r--csc/macros-test.csc25
1 files changed, 22 insertions, 3 deletions
diff --git a/csc/macros-test.csc b/csc/macros-test.csc
index 23a9cfc..6211131 100644
--- a/csc/macros-test.csc
+++ b/csc/macros-test.csc
@@ -9,7 +9,10 @@
lexical-set-name
lexical-set?
make-constant
+ make-lexical-ref
make-lambda-case
+ make-letrec
+ make-library-ref
void?)
(only (csc testing)
assert-equal
@@ -175,12 +178,28 @@
builtins-environment)))
-(test builtin-case-lambda
+(test builtin-case-lambda-cases
(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) '()))
+ (make-lambda-case '(x y z) #f #f (make-sequence (make-void) (make-constant 5))
+ (make-lambda-case '(a b c) 'd #f (make-sequence (make-void) (make-constant 6)) '()))
(expand
'(case-lambda
((x y z) (quote 5))
((a b c . d) (quote 6)))
builtins-environment)))
+
+
+(test builtin-case-lambda-defines
+ (assert-equal ir1=?
+ (make-lambda-case '(x) #f #f
+ (make-letrec #t '(a b) #f
+ (list (make-constant 6)
+ (make-lexical-ref 'a #f))
+ (make-sequence (make-void) (make-constant 7))))
+ (expand
+ '(case-lambda
+ ((x)
+ (builtin-define a (quote 6))
+ (builtin-define b a)
+ (quote 7)))
+ builtins-environment)))