test-check

pablore 2019-01-24T19:33:58.005700Z

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

2019-01-24T19:37:10.006300Z

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

pablore 2019-01-24T19:37:44.006600Z

I dont understand what you mean

2019-01-24T19:38:17.007100Z

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

pablore 2019-01-24T19:39:41.007800Z

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

👍 1
2019-01-24T19:41:27.009100Z

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

2019-01-24T19:41:42.009400Z

might help to divide by Integer/MAX_VALUE first I guess

2019-01-24T19:41:46.009600Z

to get it between 0 and 1

pablore 2019-01-24T19:42:10.009800Z

thanks

👍 1
2019-01-24T19:42:44.010400Z

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

aisamu 2019-01-24T21:26:20.016800Z

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!)

2019-01-24T21:43:01.017100Z

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

aisamu 2019-01-25T12:25:39.018400Z

Great, thanks for the guidance!

👍 1
aisamu 2019-01-24T23:11:49.017200Z

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)

2019-01-24T23:19:43.017500Z

maybe this commit removed it by accident? https://github.com/gfredericks/test.chuck/commit/b45fb4db83f66

2019-01-24T23:19:57.017700Z

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

2019-01-24T23:25:16.018Z

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

2019-01-24T23:26:38.018200Z

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