我相信这是“按设计”的,并依赖于扩展`clojure.test`行为的某些工具。`clojure.test`命名空间文档字符串中有以下内容说到:
SAVING TEST OUTPUT TO A FILE
All the test reporting functions write to the var *test-out*. By
default, this is the same as *out*, but you can rebind it to any
PrintWriter. For example, it could be a file opened with
clojure.java.io/writer.
有一个`with-test-out`宏,专门用于测试报告器,以便它们可以依赖此行为
(defmacro with-test-out
"Runs body with *out* bound to the value of *test-out*."
{:added "1.1"}
[& body]
`(binding [*out* *test-out*]
~@body))