Skip to content

Commit 15d6425

Browse files
dynj: test bind-fn*
1 parent 5d5a831 commit 15d6425

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/active/clojure/dynj_test.clj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
(dynj/binding [foo (fn [x] (* x 2))]
2020
(t/is (= 8 @(future (foo 4))))))
2121

22-
(t/deftest bound-fn-test
22+
(t/deftest bound-fn*-test
2323
;; bind a function to current bindings
2424
(let [f (dynj/binding [foo (fn [x] (* x 2))]
2525
(dynj/bound-fn* (fn [v]
@@ -30,6 +30,12 @@
3030
(fn [v] (foo v)))]
3131
(t/is (thrown? Exception (f 4)))))
3232

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+
3339
(t/deftest with-bindings*-test
3440
(t/is
3541
(= 7

0 commit comments

Comments
 (0)