Is there a clojure.test - compatible testing library or testing method that makes it easier to display structured data as I test properties of it? Simplified example: testing properties of a map. Using clojure.test, here's what I am thinking:
(require '[clojure.test :as t])
(defn valid-map? [m] ...) ; complex predicate goes here
(t/deftest example
(doseq [m [{} {} {} {}]]
(t/testing m
(t/is (valid-map? m)))))
By default the test runner will just show the symbol m instead of the runtime value of m, so I have to put the context "back in" by using t/testing.
This kinda works to display the data for the map in the test context so I can see why the map currently being tested fails, but it's clearly unwieldy to turn a map into a string like this. How do you keep the "data under test" visible as you run tests and display results?(if it matters, I use Emacs and CIDER's test runner for dev)
I think this ClojureVerse thread may cover what I'm looking for: https://clojureverse.org/t/the-best-test-runner-kaocha-or-something-else/9746/8
there's plenty of ways to do this. matcher-combinators can do it
hmm maybe not if there's a predicate
I came back here to report that rewriting my predicate using matcher-combinators solved my exact problem!