Fork me on GitHub
#meander
<
2022-01-18
>
prepor11:01:05

Hi! I like to use matchers in tests, like https://github.com/nubank/matcher-combinators But I'm not happy with this particular library and all known alternatives (including mine). I'm thinking about integrating meander with clojure.test. What do you think, does it makes sense? Maybe someone already tried or use it in this way?

noprompt16:01:25

This is something that I've experimented with/wanted to do, integrating Meander with clojure.test, but Meander doesn't have failure reporting or explanation right now. I've mostly used Meander in tests this way

(t/is (m/find result {:x (m/some) :y (m/some)} true)
      "result has the right shape")

prepor17:01:22

Yes, without the "why didn't match" explanation it has bad fit for full-scale usage in tests... As I understand, the generation of useful "explanations" for meander is a really hard or even unsolvable problem. But maybe it can be done in a different way? Clojure development is really dynamic and almost always includes REPL. So, maybe we can make an interactive step-based debugger with access to backtracking, etc. I think we can make it REPL friendly, by for example memoizing the last failed expect / actual pairs in the scope of tests. What do you think? Such a tool could be useful not only for tests but for general meander development / debugging.