Liking cljdoc? Tell your friends :D

testdoc

GitHub Actions for test workflow GitHub Actions for lint workflow Dependencies Status Clojars Project

Yet another doctest implementation in Clojure

Usage

testdoc extends clojure.test/is macro.

=> (require '[clojure.test :as t]
=>          'testdoc.core)
nil

=> (defn myplus
=>   "Add a and b
=>
=>   => (myplus 1 2)
=>   3
=>   => (myplus 2
=>   =>       3)
=>   5"
=>   [a b]
=>   (+ a b))
any?

=> (t/deftest myplus-test
=>   (t/is (testdoc #'myplus)))
any?

=> (t/test-var *1)
nil

Testing external documents

=> (require '[clojure.java.io :as io])
nil

=> (t/deftest external-document-test
=>   (t/is (testdoc (slurp (io/file "test/resources/README.adoc")))))
any?

=> (t/test-var *1)
nil

Other works

License

Copyright © 2018-2020 Masashi Iizuka

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Can you improve this documentation? These fine people already did:
liquidz & Masashi Iizuka
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close