Fork me on GitHub

does anyone happen to know any good (testing) libraries for asserting facts about deeply nested structures in a "fuzzy" way?


For example expectations offers simple checks like (expect {:foo 1} (in {:foo 1 :cat 4})), what I'm looking for is similar but with deeply nested data structures where some parts need to match exactly while others should a) accept extra elements, and/or b) ignore the order of elements


meander could be a good fit


an interesting suggestion, thanks


That looks quite promising, thanks


👍 for matcher-combinators - that's what I use at my library check. Just be aware that some checks are harder, and it can slow down or even lock up your tests if you structure is too big (but it's incredibly rare in the real world - I only had 1 case where this posed an issue)


question about nubank/matcher-combinators: the library seems quite nice, but I'm having trouble getting the output look correct. To be precise: both emacs/cider and cursive seem to have trouble rendering the ANSI escape codes and instead show the raw escape sequence, e.g. [31m:a[0m instead of :a (in red). It works fine from the command line (e.g. lein test).


(I can circumvent this with a test fixture where I bind matcher-combinators.ansi-color/*use-color* to false, but this seems tedious just to get the output readable)