test-check

aengelberg 2016-09-15T20:31:27.000016Z

Is there a way to get a variant of gen/any that does not return NaN?

aengelberg 2016-09-15T20:32:49.000017Z

My use case is that I want to do an operation on two different types of datastructures and verify that the two results are equal. The problem is that, when the outputs are structurally equal but both have NaN deeply nested inside of them, = will return false.

aengelberg 2016-09-15T20:34:02.000018Z

So, the generator can't just not return NaN, I would need it to not return NaN at any level of nesting.

2016-09-15T23:28:53.000019Z

man I needed that for test.check itself

2016-09-15T23:29:08.000020Z

I wonder what I did

2016-09-15T23:30:12.000023Z

looks like I used a custom recursive generator

2016-09-15T23:32:56.000024Z

It was oriented at edn which afaik can't handle infinities either

2016-09-15T23:33:22.000025Z

But NaN is pretty poisonous

2016-09-15T23:33:46.000026Z

You could add something to test.chuck if you'd find that useful