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

前端 未结 3 1276
感情败类
感情败类 2021-02-13 09:12

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:54

    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.

提交回复
热议问题