Make monger.internal.fn/expand-all-with more flexible
This commit is contained in:
parent
9b9005448b
commit
5a2ab1a22b
2 changed files with 3 additions and 3 deletions
|
|
@ -66,7 +66,7 @@
|
|||
;; clojure.lang.AFn subclasses. MK.
|
||||
clojure.lang.AFunction
|
||||
(expand-all [f] (f))
|
||||
(expand-all-with [f expander] (expander (f)))
|
||||
(expand-all-with [f expander] (expander f))
|
||||
|
||||
Object
|
||||
(expand-all [x] x)
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@
|
|||
}))
|
||||
|
||||
(deftest test-expand-all-with
|
||||
(let [expander-fn (fn [v]
|
||||
(* 3 v))]
|
||||
(let [expander-fn (fn [f]
|
||||
(* 3 (f)))]
|
||||
(are [i o] (is (= (expand-all-with i expander-fn) o))
|
||||
{ :a 1 :int (fn [] 3) } { :a 1 :int 9 }
|
||||
{ :v [(fn [] 1) (fn [] 11)] :m { :inner (fn [] 3) } :s "Clojure" } { :v [3 33] :m { :inner 9 } :s "Clojure" })))
|
||||
|
|
|
|||
Loading…
Reference in a new issue