Add a simple test for the map function

This commit is contained in:
Konstantin Nazarov 2024-09-15 16:23:57 +01:00
parent 049aeef62f
commit 2e37e4160d
Signed by: knazarov
GPG key ID: 4CFE0A42FA409C22

View file

@ -43,3 +43,10 @@
(fn add-four (x) (+ x four)) (fn add-four (x) (+ x four))
(assert (= (add-four 5) 9)) (assert (= (add-four 5) 9))
;; Passing lisp functions to native functions as parameters
;; (map is implemented in C++)
(assert (= (map '(1 2 3) (fn square (x) (* x x)))
'(1 4 9)))