Clojurians
# test-check

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

lgastako 04:25:35

Is there an idiomatic way to test that a function returns nil when given any value of any type other than the expected type? Or in general to generate something like “any value of any type exception this one”?

lucasbradstreet 10:44:16

lgastako: you can feed it gen/any, but it’ll be limited in the types that it can emit and you’d still need to test whether it sometimes returns a value when given the correct type. It doesn’t feel like the sort of thing I’d property test though.