This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-17
Channels
- # adventofcode (25)
- # announcements (2)
- # babashka (16)
- # babashka-sci-dev (16)
- # beginners (213)
- # calva (15)
- # clj-kondo (126)
- # clj-on-windows (1)
- # cljdoc (5)
- # cljfx (1)
- # cljs-dev (6)
- # clojure (230)
- # clojure-europe (38)
- # clojure-nl (3)
- # clojure-uk (3)
- # conjure (10)
- # core-async (15)
- # cursive (33)
- # fulcro (58)
- # hyperfiddle (4)
- # jobs-discuss (1)
- # kaocha (5)
- # lsp (46)
- # meander (3)
- # off-topic (30)
- # polylith (10)
- # portal (9)
- # re-frame (5)
- # reitit (7)
- # releases (2)
- # ring (17)
- # sci (8)
- # shadow-cljs (6)
- # specter (1)
- # sql (1)
- # testing (9)
- # tools-deps (4)
- # vim (12)
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
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)