ClojureDocs

导航

命名空间

deftest

clojure.test

自 1.1 版起提供
  • (deftest 名称 & 正文)
Defines a test function with no arguments.  Test functions may call
other tests, so tests may be composed.  If you compose tests, you
should also define a function named test-ns-hook; run-tests will
call test-ns-hook instead of testing all vars.
 Note: Actually, the test body goes in the :test metadata on the var,
and the real function (the value of the var) calls test-var on
itself.
 When *load-tests* is false, deftest is ignored.