Fork me on GitHub
#test-check
<
2016-09-15
>
aengelberg20:09:27

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

aengelberg20:09:49

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.

aengelberg20:09:02

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

gfredericks23:09:53

man I needed that for test.check itself

gfredericks23:09:08

I wonder what I did

gfredericks23:09:12

looks like I used a custom recursive generator

gfredericks23:09:56

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

gfredericks23:09:22

But NaN is pretty poisonous

gfredericks23:09:46

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