aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArun Isaac2021-07-20 16:58:48 +0530
committerArun Isaac2021-07-20 16:58:48 +0530
commitcdedc54e7c51755103d78014e8a8773d82110c63 (patch)
treee4e53789892a34e5d70f7ae242b8743e51c3b21e /tests
parent54d5ce4ecdc414c74afd3cf2b37fbebb82c3cc81 (diff)
downloadccwl-cdedc54e7c51755103d78014e8a8773d82110c63.tar.gz
ccwl-cdedc54e7c51755103d78014e8a8773d82110c63.tar.lz
ccwl-cdedc54e7c51755103d78014e8a8773d82110c63.zip
ccwl: Set default value of lambda** n-ary arguments to '().
* ccwl/utils.scm (lambda**): Set default value of lambda** n-ary arguments to the empty list. Document this in the docstring. * tests/utils.scm ("default value of lambda** unary argument should be #f", "default value of lambda** n-ary argument should be the empty list"): New tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/utils.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/utils.scm b/tests/utils.scm
index 5c5bfd1..bc9315d 100644
--- a/tests/utils.scm
+++ b/tests/utils.scm
@@ -70,6 +70,16 @@
(list foo aal vale pal naal irandu sol))
1 2 #:vale 123 #:naal 321 456))
+(test-equal "default value of lambda** unary argument should be #f"
+ #f
+ ((lambda** (#:key foo)
+ foo)))
+
+(test-equal "default value of lambda** n-ary argument should be the empty list"
+ '()
+ ((lambda** (#:key* foo)
+ foo)))
+
(test-assert "syntax-lambda**"
(equal? (list #'1 #'2 #'123 (list #'1 #'2 #'3))
((syntax-lambda** (a b #:key foo #:key* bar)