`clojure.test.check.generators/keyword` returns the keyword `:/`, which is invalid, this is presumably to be consistent with the `symbol` generator.
However, this makes the generator less useful than it could be for testing, since the handling of that keyword is undefined and inconsistent, e.g. in
I have attached a patch that changes the behaviour of that generator. (CA signed)
Ruling from Alex Miller on slack:
:/ is "open for the language to start interpreting" and not an invalid keyword so should be ok to generate. and cljs should fix it's weirdness.
So I'll close this ticket, and somebody can create a CLJS ticket if one doesn't exist already.
I’d like to propose reopening this ticket (see https://ask.clojure.org/index.php/9427/clarify-the-position-of-as-a-keyword). If the behavior and semantics of :/ are undefined (which they are, see the link), but test.check still generates it then test.check implies that people should make sure their code can handle it.
This would be less of a problem if the implementations of Clojure and ClojureScript handled it the same way, but they don’t, and ClojureScript has no incentive to address that since it’s not valid syntax. This means that cross-platform cljc code needs extra checks or reader conditionals, to deal with input it should not have to care about.
This is of course easy to address by the user with a gen/such-that, but if people are unaware of the specific status of :/ that may seem like the wrong thing to do.
For context, the weirdness that led me to originally open this ticket was caused by this CLJS inconsistency:
This was fixed in https://clojure.atlassian.net/projects/CLJS/issues/CLJS-3202
I've made the change and will cut a release when maven central starts working again.
Released in test.check 1.1.0