This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-27
Channels
- # bangalore-clj (2)
- # beginners (37)
- # boot (16)
- # cider (17)
- # clara (4)
- # cljs-dev (351)
- # cljsrn (16)
- # clojure (219)
- # clojure-belgium (4)
- # clojure-dev (3)
- # clojure-france (2)
- # clojure-italy (24)
- # clojure-russia (23)
- # clojure-spec (55)
- # clojure-switzerland (3)
- # clojure-uk (89)
- # clojurescript (121)
- # cursive (2)
- # datomic (29)
- # devops (2)
- # graphql (8)
- # hoplon (15)
- # immutant (5)
- # lein-figwheel (4)
- # liberator (3)
- # luminus (18)
- # off-topic (9)
- # om (6)
- # onyx (31)
- # pedestal (48)
- # precept (9)
- # re-frame (19)
- # reagent (63)
- # ring-swagger (69)
- # robots (1)
- # slack-help (14)
- # spacemacs (12)
- # sql (2)
- # test-check (4)
- # unrepl (28)
- # untangled (5)
- # yada (3)
@abhirag how long did you wait? (presumably not “forever” :) it works for me, but takes a while.
“a while” being a couple minutes
😳 why should that take a couple minutes?
a fair question :)
I did try and restrict the count to 10 to reduce time, my dev machine might be slower than yours Alex, I will try again and try and not get afraid of the cooling fans revving up :)
that definitely sounds like a problem to me
yeah, that seems weird
s/coll-of with a :count parameter will create a gen/vector with a size
@gfredericks (g/sample (g/vector g/large-integer 10) 1000)
seems like it should be close to what I’d expect and that’s fast
alexmiller: yeah that's what I was imagining
although it’s also going to put those in lists, then put that in a vector for the args, then invoke the function, then check the return is a list, reverse that list, and compare it to the input list
but even so
this is indeed pretty jacked and is already logged https://dev.clojure.org/jira/browse/CLJ-2103
but I did not fully understand this issue before
I don't understand it at a glance; let me know if it'd be helpful for me to look closer
@abhirag there is a ticket for that error case, which I think went into alpha17, not sure which you’re using
I think the guide says alpha16 right now
maybe I’m confusing that with something else. if you still see, feel free to log a jira for it
@alexmiller I am still getting this error
I haven't ever logged a defect before in clojure, but if you feel that this deserves a ticket I'll log one 🙂
yeah, I think so. you can create an account at https://dev.clojure.org/jira/secure/Signup!default.jspa and then log a defect at https://dev.clojure.org/jira/browse/CLJ
I’m still looking at your gen stuff too. It shouldn’t be that slow. I believe it’s the :kind list?
that is causing the slow-down.
yeah I had tried property testing in other languages before, that snippet was an overkill, my main motive with that was that if we already have a function tested and need to rewrite it for optimization etc. we could just use the old function to test it
now I realize that with spec all I really need is that the rewritten function have the same spec
@abhirag I noticed on your REPL example that you didn't defined the my-reverse
function
yeah I realize that 🙂 that was just to get that null pointer exception, I was gonna log a ticket to make that error message better
cool, just wondered if was on purpose :)
@abhirag the slow gen is actually already logged https://dev.clojure.org/jira/browse/CLJ-2103 and is definitely in need of some work
that actually didn't throw any exception, but as I was not getting any output, there wasn't any other way to know 🙂
I think
(stest/check `my-reverse {:clojure.spec.test.check/opts {:num-tests 10}})
I think using :into ()
in addition to :kind list?
would help