【问题标题】:How can I run automatically tests generated by spec'ed functions with `lein test`?如何使用“lein test”自动运行由指定函数生成的测试?
【发布时间】:2019-02-07 13:39:24
【问题描述】:

我有指定的函数,所以我可以使用check 运行自动生成的测试。如何使用lein test 运行这些测试?

我在努力

(deftest check-suggest-connections
  (is (= nil (spectest/summarize-results (spectest/check `suggest-connections)))))

在我的core_test.clj 但我得到了一个

java.util.concurrent.ExecutionException: Syntax error compiling at (clojure/test/check/clojure_test.cljc:95:1).
Caused by: clojure.lang.Compiler$CompilerException: Syntax error compiling at (clojure/test/check/clojure_test.cljc:95:1).
#:clojure.error{:phase :compile-syntax-check, :line 95, :column 1, :source "clojure/test/check/clojure_test.cljc"}

【问题讨论】:

    标签: clojure clojure.spec


    【解决方案1】:

    我找到了 Alex Miller 在here 中描述的解决方法

    只需在project.clj中添加:monkeypatch-clojure-test false即可。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-22
      • 1970-01-01
      • 2016-10-11
      • 1970-01-01
      • 2023-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多