Skip to content

Commit 5d5a831

Browse files
dynj: test merge-dynjs
1 parent 7a3b08e commit 5d5a831

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/active/clojure/dynj_test.clj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,17 @@
4444

4545
(t/deftest defn-dynj-default-implementation-test
4646
(t/is (= 9 (bar 3))))
47+
48+
(t/deftest merge-dynjs-test
49+
(let [b1 {#'foo #'inc}
50+
b2 {#'bar (fn [x] (str x "foo"))}
51+
bindings (dynj/merge-dynjs b1 b2)]
52+
(t/is "17foo"
53+
(dynj/with-bindings* bindings
54+
(fn []
55+
(bar (foo 16)))))
56+
(dynj/merge-dynjs b1 b2))
57+
(t/is
58+
(thrown? AssertionError
59+
(dynj/merge-dynjs {#'println (fn [s] (str s "foo"))}
60+
{#'foo #'inc}))))

0 commit comments

Comments
 (0)