scalacheck Questions
4
Solved
I wonder why Arbitrary is needed because automated property testing requires property definition, like
val prop = forAll(v: T => check that property holds for v)
and value v generator. The u...
Anuran asked 29/6, 2015 at 8:32
2
Solved
I can find many examples of setting maximum sizes for generators, but how do I generate lists between a min and max length?
Jurat asked 15/1, 2016 at 13:10
3
Solved
What is the best way to generate a non empty string, when in the context of something like this
private def createIndexFn() = {
for{
someChar <- Gen.alphaString
aNumber <- Gen.choose(1,...
Key asked 24/8, 2016 at 14:53
3
Solved
This was asked as a "bonus question" in https://mcmap.net/q/736529/-make-scalacheck-tests-deterministic, but not answered:
Is there a way to print out the random seed used by ScalaCheck, so that y...
Coons asked 2/2, 2014 at 7:38
4
Solved
I would like to make my ScalaCheck property tests in my specs2 test suite deterministic, temporarily, to ease debugging. Right now, different values could be generated each time I re-run the test s...
Stereochromy asked 28/9, 2012 at 11:49
2
Solved
I'd like to have all my properties always be tested with at least a fixed set of special values in addition to some random values. I'd like to define this in my generator specification, not in ever...
Idioblast asked 27/9, 2011 at 12:55
2
Solved
I need to generate strings with the same length. I can't realize how. Many thanks
val s = for {
x <- Gen.alphaStr
} yield ...
Leapt asked 7/11, 2014 at 19:26
3
Solved
I have read in the ScalaCheck user guide that it's a tool for testing Scala and Java programs.
I wonder, is it just marketing, or testing Java-only codebase with it would be a reasonable idea? And...
Kostman asked 7/11, 2013 at 15:53
2
Solved
I observed the following unexpected behaviour when using ScalaCheck's Gen.pic, which (for me) indicates that its picking is not quite random, even though its documentation says so:
/** A generator...
Chew asked 8/5, 2017 at 4:52
1
Solved
How to generate a list of n unique values (Gen[List[T]]) from a set of values (not generators) using ScalaCheck? This post uses Gen[T]* instead of a set of values, and I can't seem to rewrite it to...
Haggle asked 6/5, 2017 at 21:26
1
Solved
I am fairly new to ScalaCheck (and Scala entirely) so this may be a fairly simple solution
I am using ScalaCheck to generate tests for an AST and verifying that the writer/parser work. I have thes...
Carolinian asked 3/3, 2017 at 14:48
1
Solved
Is there a way to have SBT re-run only the tests that have failed in the last run of the test suite? For example, if I run sbt test and 3 out of the 20 tests I run fail, is there any command I can ...
Bing asked 4/3, 2017 at 18:50
2
Solved
I'm running ScalaCheck tests in sbt, and if my test fails because the code under test throws an exception, the test report shows the failed test, the thrown exception and the message, but not the e...
Ardeen asked 24/6, 2014 at 21:13
4
Solved
I want to generate a list of integers corresponding to a list of generators in ScalaCheck.
import org.scalacheck._
import Arbitrary.arbitrary
val smallInt = Gen.choose(0,10)
val bigInt = Gen....
Sourdough asked 25/11, 2012 at 7:27
3
Solved
I'm trying to generate random data with Scalacheck. I have a hierarchy of case classes with many properties. The only way I've found so far to populate the case classes is like this :
case class D...
Waite asked 27/10, 2015 at 14:32
4
Solved
I'm trying to right a good number generator that covers uint64_t in C. Here is what I have so far.
def uInt64s : Gen[BigInt] = Gen.choose(0,64).map(pow2(_) - 1)
It is a good start, but it only g...
Loricate asked 18/6, 2016 at 15:44
3
Solved
I'm seeing what seems to be a very obvious bug with scalacheck, such that if it's really there I can't see how people use it for recursive data structures.
This program fails with a StackOverflowE...
Astrophysics asked 7/11, 2013 at 6:22
0
I have a method that is able to persist any type, as long as that type has a io.circe.Encoder[A] instance, something like this:
def persist[A](a: A)(implicit ea: Encoder[A]): Boolean
Now while t...
Sailfish asked 20/4, 2016 at 13:52
4
Solved
I'm trying to create a generator that produces (non-zero-length) legal unicode strings, with scalacheck 1.6.6 and specs 1.7 (scala 2.8.1).
I hoped I could just create generators like:
object Gene...
Otis asked 7/12, 2010 at 16:32
2
Solved
I want to create a generator in ScalaCheck that generates numbers between say 1 and 100, but with a bell-like bias towards numbers closer to 1.
Gen.choose() distributes numbers randomly between th...
Aqua asked 15/2, 2016 at 22:9
1
Solved
I'm using the frameworks mentioned in the title with the following configuration:
"com.typesafe.play" % "sbt-plugin" % "2.4.2"
"org.scalacheck" %% "scalacheck" % "1.12.4" % "test"
"org.scalatest"...
Annice asked 27/8, 2015 at 8:2
1
Solved
I'm facing a nasty exception when trying to write a test using ScalaCheck and ScalaTest. Here's my dependencies:
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "2.2.6" % "test",
"...
Debauchery asked 10/2, 2016 at 10:19
2
Solved
I am trying to generate optional parameters in ScalaCheck, without success.
There seems to be no direct mechanism for this. Gen.containerOf[Option, Thing](thingGenerator) fails because it cannot f...
Ether asked 14/9, 2013 at 6:58
1
Solved
I'm trying to solve two ScalaCheck (+ specs2) problems:
Is there any way to change the number of cases that ScalaCheck generates?
How can I generate strings that contain some Unicode characters?...
Karilynn asked 21/5, 2015 at 5:40
1
Solved
I am trying out ScalaCheck for the first time and I want to generate an ordered array of Ints.
I read the documentation and did some search but I didn't find a way to do it.
Can someone shed some...
Salacious asked 15/3, 2015 at 8:35
1 Next >
© 2022 - 2024 — McMap. All rights reserved.