Closed bonega closed 5 years ago
@bonega If you like the challenge, you can look at what I did for generative testing of into
and conj
: you can override the generators. So you can write one generative test for the vector case and one for all other associatives (I think it only generates vectors and maps at the moment). If you don't like that work, I'm happy to take it further.
@bonega I just wrote the generator for the assoc
arguments here:
https://github.com/slipset/speculative/blob/master/src/speculative/core.cljc#L67
Extending this to assoc-in
should be relatively easy now I hope: the only challenge is to generate nested vectors. It's still optional as far as I'm concerned.
Could you add some (is (caught? ...))
checks to the test to verify that the spec catches cases like (assoc-in 1 1 1)
?
Generative testing would need specs using multimethod on
type
I think. In case of avector
or another non-sparse associative only integers(<= 0 % (count coll))
is valid. I have not implemented that, is that in the scope for speculative?