diff --git a/src/monger/internal/fn.clj b/src/monger/internal/fn.clj index 46b4a6c..c3c69c4 100644 --- a/src/monger/internal/fn.clj +++ b/src/monger/internal/fn.clj @@ -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) diff --git a/test/monger/test/internal/fn.clj b/test/monger/test/internal/fn.clj index 4d7c72b..4d3f915 100644 --- a/test/monger/test/internal/fn.clj +++ b/test/monger/test/internal/fn.clj @@ -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" })))