Fork me on GitHub

Just released testdoc ver 1.4.0, doctest implementation in Clojure. Now supports to add error position(line number) information to error messages. And also works on babashka! babashka

🎉 36
👍 3

I've seen this in Rust and always thought it was cool, nice to see Clojure has a similar project.

👍 6

are there convenient ways to collapse long strings in most editors?


But why not to use test metadata? In that case you are not editing a string but normal clojure code


@U04V4KLKC Because this can test that examples you provide in docstrings are correct (as well as regular tests, via metadata).


For the same reason that seancorfield/readme exists, to turn README files into tests, so you can verify that examples in your documentation are correct.

👍 6

(although this testdoc may be a better solution, even for README files, depending on how it deals with non-test code etc)


(and we should probably direct further discussion to #testing at this point!)


For completeness, :test metadata is runnable, provided you wrap it in a fn and src/ is declared as part of your :test-paths Someone recommended that to me in Clojurians some 18 months ago and really liked the technique!