matcher-combinators icon indicating copy to clipboard operation
matcher-combinators copied to clipboard

`absent` doesn't work with `any-of`

Open kkrausse opened this issue 2 years ago • 1 comments

since this works:

(matcher-combinators.standalone/match?
 {:a matcher-combinators.matchers/absent}
 {:c 'd})
;; => true

I would expect that

(matcher-combinators.standalone/match?
 {:a (matcher-combinators.matchers/any-of
      'b
      matcher-combinators.matchers/absent)}
 {:c 'd})
;; => true

also, but actually it gives false. Using version 3.8.5.

kkrausse avatar Jul 14 '23 14:07 kkrausse

Hi, yes this seems to be a bug in the implementation. absent is implemented in a sort of tricky way but I think we can try tracking when an any-of has an absent entry and change the behavior to include the option of an absent match. I'll poke around and see if I can get this rolling

philomates avatar Jul 18 '23 09:07 philomates