mirror of
https://github.com/kanaka/mal.git
synced 2024-09-11 13:55:55 +03:00
Merge pull request #376 from bjh21/bjh21-withmeta-empty
step A: Test that metadata doesn't break empty collections.
This commit is contained in:
commit
bf5cba817e
@ -226,18 +226,30 @@
|
||||
(meta (with-meta [1 2 3] "abc"))
|
||||
;=>"abc"
|
||||
|
||||
(with-meta [] "abc")
|
||||
;=>[]
|
||||
|
||||
(meta (with-meta (list 1 2 3) {"a" 1}))
|
||||
;=>{"a" 1}
|
||||
|
||||
(list? (with-meta (list 1 2 3) {"a" 1}))
|
||||
;=>true
|
||||
|
||||
(with-meta (list) {"a" 1})
|
||||
;=>()
|
||||
|
||||
(empty? (with-meta (list) {"a" 1}))
|
||||
;=>true
|
||||
|
||||
(meta (with-meta {"abc" 123} {"a" 1}))
|
||||
;=>{"a" 1}
|
||||
|
||||
(map? (with-meta {"abc" 123} {"a" 1}))
|
||||
;=>true
|
||||
|
||||
(with-meta {} {"a" 1})
|
||||
;=>{}
|
||||
|
||||
;;; Not actually supported by Clojure
|
||||
;;;(meta (with-meta (atom 7) {"a" 1}))
|
||||
;;;;=>{"a" 1}
|
||||
|
Loading…
Reference in New Issue
Block a user