These are chat archives for etorreborre/specs2

25th
May 2017
wedens
@wedens
May 25 2017 14:56
how can I reduce number of generated examples in scalacheck property? e.g. .set(minTestsOk = 2) doesn't work (should it?). still generates tons of examples
Fabio Labella
@SystemFw
May 25 2017 15:16
setMinTestsOk worked for me in the past (although I was using to increase the number of examples, not reduce it)
wedens
@wedens
May 25 2017 15:52
looks like it generates every possible input. not just some random samples :/
Fabio Labella
@SystemFw
May 25 2017 15:52
what does?
wedens
@wedens
May 25 2017 15:53
scalacheck
Fabio Labella
@SystemFw
May 25 2017 15:53
no that's weird
wedens
@wedens
May 25 2017 15:53
it is. and it generates empty string for a constant string Gen
I'm not drunk. I promise
Fabio Labella
@SystemFw
May 25 2017 15:54
oh I'm sure it's happening :) But it's weird and I've never seen it happening in my own scalacheck use
especially "it generates empty string for a constant string Gen:
wedens
@wedens
May 25 2017 15:56
yeah. I've never seen such things happening before
Fabio Labella
@SystemFw
May 25 2017 15:56
do you have a small bit of code demonstrating that?
like if you do yourGen.sample.get you always get the empty string? that's super weird
wedens
@wedens
May 25 2017 15:56
no. not always
Fabio Labella
@SystemFw
May 25 2017 16:01
I can't reproduce...
scala> val a: org.scalacheck.Gen[String] = org.scalacheck.Gen.const("hello")
scala> List.fill(100000)(a.sample.get).forall(_ == "hello")

res16: Boolean = true
wedens
@wedens
May 25 2017 16:02
hm. it's a single property that does such thing. another one with the same Gen doesn't generate empty strings
I think it tries to shrink
rickynils/scalacheck#203
so.. it's a feature
Fabio Labella
@SystemFw
May 25 2017 16:06
that makes more sense :)
wedens
@wedens
May 25 2017 16:08
it kind of does and doesn't at the same time :)
wedens
@wedens
May 25 2017 17:46
how can I run scalacheck with the same seed when I use specs2?
Eric Torreborre
@etorreborre
May 25 2017 17:49
You cannot do that anymore. The random generator used to be accessible in scalacheck but now it's private
wedens
@wedens
May 25 2017 17:51
this is weird. why would they kill such important feature
Eric Torreborre
@etorreborre
May 25 2017 18:06
I think it was just supposed to be temporary
My client is Messi g up my messages sorry