We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
bind-fn*
1 parent 5d5a831 commit 15d6425Copy full SHA for 15d6425
test/active/clojure/dynj_test.clj
@@ -19,7 +19,7 @@
19
(dynj/binding [foo (fn [x] (* x 2))]
20
(t/is (= 8 @(future (foo 4))))))
21
22
-(t/deftest bound-fn-test
+(t/deftest bound-fn*-test
23
;; bind a function to current bindings
24
(let [f (dynj/binding [foo (fn [x] (* x 2))]
25
(dynj/bound-fn* (fn [v]
@@ -30,6 +30,12 @@
30
(fn [v] (foo v)))]
31
(t/is (thrown? Exception (f 4)))))
32
33
+(t/deftest bind-fn*-test
34
+ (let [bindings {#'foo #'str}
35
+ f (fn [x] (foo (inc x)))
36
+ bound (dynj/bind-fn* bindings f)]
37
+ (t/is (= "5" (bound 4)))))
38
+
39
(t/deftest with-bindings*-test
40
(t/is
41
(= 7
0 commit comments