How do I unit test clojure.core.async go macros?

前端 未结 3 1602
自闭症患者
自闭症患者 2021-02-13 09:27

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.

3条回答
  •  独厮守ぢ
    2021-02-13 09:55

    I'm using an approach similar to Leon's, but with no extra go blocks:

    (defn 

    You can use it simply as:

    (is (= 42 (

    Most of the time I just want to read the value from the channel without any extra hassle.

提交回复
热议问题