mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-19 01:18:40 +03:00
Fix macros test; add test for zip
There were some errors in the call to Dyanmic.map. I've fixed those! I've also added a test for zip.
This commit is contained in:
parent
ba0bfe7ed7
commit
1602e49320
@ -59,10 +59,15 @@
|
||||
(list 'let (array x 1) (list '= x 1))))
|
||||
|
||||
(defmacro test-map []
|
||||
(let [mapped (Dynamic.map length '(a) '(b c) '(d e f))]
|
||||
(let [mapped (Dynamic.map length '((a) (b c) (d e f)))]
|
||||
(Dynamic.and (Dynamic.and (= 1 (Dynamic.car mapped)) (= 2 (Dynamic.cadr mapped))) (= 3
|
||||
(Dynamic.caddr mapped)))))
|
||||
|
||||
(defmacro test-zip []
|
||||
(let [zipped (Dynamic.zip array '('a 'd) '('c 'o) '('e 'g))]
|
||||
(Dynamic.and (= 'ace (Symbol.join (eval (Dynamic.car zipped))))
|
||||
(= 'dog (Symbol.join (eval (Dynamic.cadr zipped)))))))
|
||||
|
||||
(deftest test
|
||||
(assert-true test
|
||||
(test-let-do)
|
||||
@ -229,4 +234,7 @@
|
||||
(assert-true test
|
||||
(test-map)
|
||||
"map works as expected")
|
||||
(assert-true test
|
||||
(test-zip)
|
||||
"zip works as expected")
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user