Closed gabrielgiussi closed 4 years ago
Do you think it is a good solution for this issue to modify the predicate so it uses the set matcher if the expected value is a java set?
Makes sense to me - although I don't see anyone using a Java Set as expected value
Makes sense to me - although I don't see anyone using a Java Set as expected value
Perhaps not when using a literal, but what if you're deriving the actual value from another function or a generator?
Solution for issue https://github.com/nubank/matcher-combinators/issues/116.
Clojure only recognizes
IPersistentSet
asset?
becausejava.util.Set
has no immutability semantic baked in. For the purposes of matching, we only need to read the sets, so this PR applies set matching semantics to instances ofjava.util.Set
as well asclojure.lang.IPersistentSet
.