ClojureDocs

导航

命名空间

is

clojure.test

从 1.1 开始可用
  • (is 表单)
  • (is 表单 msg)
Generic assertion macro.  'form' is any predicate test.
'msg' is an optional message to attach to the assertion.

Example: (is (= 4 (+ 2 2)) "Two plus two should be 4")
 Special forms:
 (is (thrown? c body)) checks that an instance of c is thrown from
body, fails if not; then returns the thing thrown.
 (is (thrown-with-msg? c re body)) checks that an instance of c is
thrown AND that the message on the exception matches (with
re-find) the regular expression re.