How do I unit test clojure.core.async go macros?
问题 I'm trying to write unit tests when using core.async go macros. Writing the test naively, as follows, appears that the code inside the go blocks doesn't get executed. (ns app.core-test (:require [clojure.test :refer :all] [clojure.core.async :as async])) (deftest test1 [] (let [chan (async/chan)] (async/go (is (= (async/<! chan) "Hello"))) (async/go (async/>! chan "Hello")))) I've managed to get the following working, but it's extremely hacky. (deftest test1 [] (let [result (async/chan) chan