Fork me on GitHub
#clojure-spec
<
2016-10-02
>
jrheard00:10:22

@gfredericks - have you ever seen s/check output the empty list like i mentioned above? sorry to bug you directly, i’ve just seen your name around test.check-related things, figured you might have an answer off the top of your head 🙂

jrheard00:10:51

i’m a complete newbie to generative testing, so for all i know this is normal well-understood behavior, but i’m having trouble making heads or tails of it

gfredericks00:10:35

I expect it's a clojure.spec-related thing

gfredericks00:10:00

I've seen that happen when I've used it but can't remember why

jrheard00:10:28

cool, i’ll keep poking at it

lvh18:10:48

I found my problem from yesterday: between -11 and -12, a nil spec changed meaning

lvh18:10:59

ostensibly from meaning any? to silent failure

lvh18:10:26

I appreciate that there might be a bootstrapping failure, but that seems like it could be found at spec definition time and not with an NPE thrown from a reify

bfabry18:10:10

generated values are still checked against the spec, I'm guessing there's something in the environment causing .format to return a differently formatted date

lvh18:10:21

oh, huh; I wonder if that’s now or I’m just horribly misremembering

lvh18:10:32

(s/def ::a integer?)
(s/def ::b (s/with-gen string? #(s/gen ::a)))
(sg/sample (s/gen ::a))
(sg/sample (s/gen ::b))
.. confirms

lvh18:10:58

I guess .format isn’t awfully specific

bfabry18:10:45

there's probably some dumb version of the JS engine that returns "Monday the 2nd of Feburary 10:13PM Australian eastern daylight savings time"

lvh18:10:35

Moment.js takes explicit format strings though, so hopefully easy to recover from

Alex Miller (Clojure team)23:10:14

@lvh There was a bug introduced with conforming nilable in 12 that is fixed in 13

lvh23:10:28

@alexmiller In -alpha11, a nil spec was effectively any? afaict

lvh23:10:42

that’s gone in -12 and -13, which broke my tests; but really it was just exposing something that was a bug anyway

lvh23:10:20

this is not a problem unless you’re generating specs, which I guess is the part of clojure.spec I’m exercising a little more that most folks 😄

lvh23:10:29

(my generated specs included nils by accident; that was actually a bug)

jrheard23:10:02

@alexmiller - have you seen situations where (stest/check `foo/bar) returns []? what type of mistake does that return value usually indicate? i’m having a hard time figuring out what causes it - it seems to return [] sometimes and eg [{:spec #object[cljs.spec.t_cljs$spec8685], :clojure.test.check/ret {:result true, :num-tests 1000, :seed 1475452376922}, :sym voke.input/intended-directions->angle}] other times, the behavior varying from run to run when none of the code has changed