[CLJ-2079] [spec] Generator overrides for spec aliases are not respected Created: 08/Dec/16 Updated: 08/Oct/18
|Affects Version/s:||Release 1.9|
|Fix Version/s:||Release 1.11|
Generator overrides for spec aliases are not respected.
Providing a generator override for the original spec works as expected:
|Comment by Alex Miller [ 08/Dec/16 5:02 PM ]|
Probably a missing delay in the alias case - there's another ticket that has the same cause.
|Comment by Nate Smith [ 08/Dec/16 6:43 PM ]|
Looks like it might be because gensub looks for matching overrides by calling spec-name, which returns the wrong value for spec aliases.
|Comment by Charles Despointes [ 20/Jun/17 1:19 PM ]|
I've a somewhat similar issue. I think it is related.
I'm somewhat expecting it generates me an integer like it would have with a direct aliasing to ::bar in ::foo definition. But it doesn't and keep the with-gen binded generator.
|Comment by James Gatannah [ 04/Mar/18 12:07 AM ]|
I think I'm probably running into this, except that there seems to be some non-determinism involved.
It seems to behave differently, depending on whether I run it from within a deftest or from the REPL. (Running it from the REPL seems to fail every time. Running it inside deftest seems much more reliable).
My really long-winded description is at https://groups.google.com/forum/#!topic/clojure/zPWPmQGm94w
The sample where I tried to document exactly what I'm seeing is at https://gist.github.com/jimrthy/21851c52a8cd6b04a31ed08b1d0a7f04 (when I wrote that, running inside deftest seemed to work every time. That is not the case).
If nothing else, it would be nice to have better error messages that include the name of the spec it's failing to generate. Actually, that would be generally helpful and possibly worth its own ticket. Please let me know if you'd like me to create one.