Use negative matchers with caution
masterNegative matchers assert the absence of something. They are available but generally discouraged because they can reduce code readability.
mismatch: A negation matcher that passes if the underlying matcher fails to match the actual value.absent: Specifically for maps. Matches when the actual map is missing the key associated with theabsentmatcher.
Best Practice: Use absent only when the absence of a key is behaviorally significant. For general presence checks, prefer using a positive matcher like any?.
;; Example: Using mismatch to assert absence in a list
(is (match? (mismatch (embeds [odd?])) actual))
;; Example: Using absent for map key absence
(is (match? {:a absent :b 1} {:b 1}))