diff --git a/src/active/clojure/monad.cljc b/src/active/clojure/monad.cljc index 94b159b..ab00a6f 100644 --- a/src/active/clojure/monad.cljc +++ b/src/active/clojure/monad.cljc @@ -426,7 +426,7 @@ [state state] (put-state!? m) - [nil state] + [nil (put-state-state m)] :else (let [res (run-command run env state m)] @@ -558,7 +558,7 @@ [state state] (put-state!? m) - [nil state] + [nil (put-state-state m)] :else (let [res (run-command run env state m)] diff --git a/test/active/clojure/monad_test.cljc b/test/active/clojure/monad_test.cljc index 58e67a2..1d1ddac 100644 --- a/test/active/clojure/monad_test.cljc +++ b/test/active/clojure/monad_test.cljc @@ -307,6 +307,14 @@ (put-state! {:x 'bar}) (return x)))))) +(deftest put-state-test + (is (= [nil 42] + (run-free-reader-state-exception (null-monad-command-config {} {}) + (put-state! 42)))) + (is (= [nil 42] + (run-monadic (null-monad-command-config {} {}) + (put-state! 42))))) + (deftest null-config (let [c (null-monad-command-config nil nil)] (is (unknown-command? ((monad-command-config-run-command c)