Fork me on GitHub
#clojure-spec
<
2017-07-26
>
Alex Miller (Clojure team)01:07:13

@aviflax there are a couple known issues related to s/coll-of and the other collection specs. if you posted your args spec, I might be able to suggest something

avi13:07:05

@alexmiller great, thank you! I’m working on a gist now — almost done, but having a snag with tools.deps.alpha. Where/how should I report this snag?

Alex Miller (Clojure team)15:07:57

@aviflax The jira link for tools.deps is on the readme page

avi15:07:34

Got it — will report there. Thanks!

avi16:07:47

@alexmiller this reproduces and demonstrates my problem and how I’m currently working around it by setting :num-tests low: https://gist.github.com/aviflax/1a9ba7e73d45157bfc03f6b11c3b9b18

Alex Miller (Clojure team)16:07:05

Two things: 1) there is a known issue when using s/coll-of with :kind but without :into (https://dev.clojure.org/jira/browse/CLJ-2103) - this should be fixed soon, but adding your own :into clause will work around it. This could easily be enough. 2) using s/coll-of with a :gen-max option can also help constrain the size of generated collections

Alex Miller (Clojure team)16:07:24

actually, #2 may be a non-issue for you since you’re using :count

Alex Miller (Clojure team)16:07:52

so I’d recommend in line 20ish, adding :into []

avi18:07:44

@alexmiller will do — thanks so much!

gfredericks19:07:15

would a conj talk on test.check be useful? if so, what angle exactly? usage patterns? implementation details? something else? I haven't really considered this before because I figured that reid had already talked about it a few years back and it hadn't changed much since then, but maybe that's not true and/or not a good reason

avi19:07:44

@alexmiller I added the :into but it doesn’t seem to have made a difference ¯\(ツ)

avi19:07:17

adding :gen-max doesn’t seem to make a difference either 😞

Alex Miller (Clojure team)23:07:18

Well on the upside, you can rule those out as the problem :)

avi00:07:29

Should I open a JIRA ticket?

avi00:07:03

I’ve shrunk down the example just a bit by removing the CSV parsing… it’s still slow 😓

misha20:07:32

@gfredericks I'd listen about approaching to property based testing, something in between cookbook and best practices, to improve test-design intuition (what ever that means)

gfredericks20:07:30

@misha cool; I think that's more or less what I meant by "usage patterns", maybe

wilkerlucio20:07:18

@gfredericks a fresher way to go about it might be using spec as reference, how to use and extend generators for specs, and how to write tests using those

gfredericks20:07:22

yeah, intersecting with spec would probably be more relevant. potentially harder for me since I haven't used spec very much

wilkerlucio20:07:11

you can use that as a reason to get more into spec too 🙂

danielcompton20:07:03

@gfredericks the hardest thing I've found with property based testing is figuring out useful properties that can be calculated, without reimplementing the original function

gfredericks20:07:55

yeah I think that's common. that would fit better as a pure test.check patterns talk

dadair22:07:11

is there a way to do nested/consecutive multi-specs? e.g., {:type :a}, then also expect :subtype :b, and now multi-spec based off :subtype?

Alex Miller (Clojure team)23:07:34

You can have a multispec return a spec that is another multispec or you can dispatch on both at the same time using a more complicated dispatch function

Alex Miller (Clojure team)23:07:38

@gfredericks a talk on building more complex generators would be very useful and relevant to both spec and test.check

gfredericks23:07:39

@alexmiller so limiting the scope to generators, enabling a deeper exploration?

Alex Miller (Clojure team)23:07:58

I think there is plenty to talk about

Alex Miller (Clojure team)23:07:32

Property test patterns is good too but less relevant re spec and has somewhat been done

gfredericks23:07:12

okay cool; that happens to also be probably the most enjoyable for me to put together

dadair23:07:02

@alexmiller do you have an example of what a multispec returning a multispec would look like? I've tried that and didn't seem to be able to get it to work