Fork me on GitHub
#test-check
<
2019-01-24
>
pablore19:01:58

Hi. I need to generate some data based on a normal distribution. How can I do that with test.check?

gfredericks19:01:10

@pablore you want to ignore the size parameter, I imagine? any desired shrinking behavior?

pablore19:01:44

I dont understand what you mean

gfredericks19:01:17

size controls how generated values start simple and get more complex as you run more trials

pablore19:01:41

Ok this is more complex than I thought xd. I'll give it a read, thanks!

👍 5
gfredericks19:01:27

if you don't care all that much, I'd say the easiest thing is to use gen/choose with 0 and Integer/MAX_VALUE and the gen/fmap with some function that converts a uniform distribution to a normal one

gfredericks19:01:42

might help to divide by Integer/MAX_VALUE first I guess

gfredericks19:01:46

to get it between 0 and 1

pablore19:01:10

thanks

👍 5
gfredericks19:01:44

(the fact that my initial questions don't have obvious answers is part of why this isn't built-in)

aisamu21:01:20

Hi! I'm trying to integrate test.chuck's checking into a cljs.test project. The readme points to a blog post where there is an example showing the full report on errors (vs. just one wrong result) Was that ever integrated into the official checking macro? I can't seem to make it work here. (The full report is terribly useful for fixing things that went wrong!)

gfredericks21:01:01

what do you mean by "full report"? I.e., what information is there? (I'm fuzzy on all this)

aisamu23:01:49

Oh, sorry for the delay! Here's the linked page - on the section "Including Results" you can see an example: http://blog.colinwilliams.name/clojure/testing/2015/01/26/alternative-clojure-dot-test-integration-with-test-dot-check.html I'm only getting the second kind of output, instead of both (or just the first)

gfredericks23:01:57

it's probably easy to interpret the output as accidentally oververbose

gfredericks23:01:16

looking more closely, it's possible that the addition of the not-falsey-or-exception? call meant that the output originally intended wasn't happening at that point, so it really did look redundant

gfredericks23:01:38

I think a PR that adds it back in would be okay, but a PR that adds custom reporting so that there's only one FAIL line printed instead of two would be even better, probably

aisamu12:01:39

Great, thanks for the guidance!

👍 5