omnipaste

dest-test.clj

whoCreated: chouser whenCreated: 2008-04-23 12:18:26 mimetype: application/x-clojure
download   paste more
(assert (=
 (let [{:keys [a], :strs [b], :syms [c]} {:a 1 "b" 2 'c 3}] [a b c])
 [1 2 3]
))

(assert (=
 (let [{:keys [a], :strs [b], :syms [c]} nil] [a b c])
 [nil nil nil]
))

(assert (=
 (let [{:keys [a], :strs [b], :syms [c]} #{:a 'c}] [a b c])
 '[:a nil c]
))

(assert (=
 (let [{:keys [a b c] :as foo} {:a 1 :b 2}] [a b c foo])
 [1 2 nil {:b 2, :a 1}]
))

(assert (=
 (let [{:keys [a b c], :as foo, :or {a 99}} {:b 2}] [a b c foo])
 [99 2 nil {:b 2}]
))

omnipaste