Questions tagged [scalacheck]

ScalaCheck is a powerful tool for automatic unit testing of Scala and Java programs.

ScalaCheck is a powerful tool for automatic unit testing of Scala and Java programs. It features automatic test case generation and minimization of failing test cases. ScalaCheck started out as a Scala port of the Haskell library QuickCheck, and has since evolved and been extended with features not found in Haskell QuickCheck .

275 questions
0
votes
1 answer

Specs2 + Scalacheck test failing due to many discarded

In a ScalaCheck + Specs2 based test, I need two dates whose distance (in days) it's at maximum of Int.MAX_VALUE. I am using at the moment ScalaCheck provided arbitraries to generating two dates: since the date generator is backed by the Long…
Edmondo
  • 19,559
  • 13
  • 62
  • 115
0
votes
1 answer

Why are these scalacheck recursive generators not equivalent?

While trying to learn the ScalaCheck tool, I wrote two versions of a Map generator (I know there is one of these built in, but this was an exercise). It seems that genMap0 and genMap00 should be equivalent, and genMap00 is bit cleaner, but in fact…
Mike Hanafey
  • 5,565
  • 4
  • 20
  • 26
0
votes
1 answer

Test a function with more than 8 parameters

The ScalaCheck api defines 8 forAll methods for creating properties from function with up to 8 parameters. Is it possible to test a function that has more than 8 parameters?
Guillaume Chérel
  • 1,478
  • 8
  • 17
0
votes
1 answer

scalacheck generator produces a null sample

what is wrong? why person is null? import org.scalacheck.{Arbitrary, Properties, Gen, Prop} import Gen._ import Prop._ case class Person(name: String) {} object QuickCheckPerson extends Properties("Person") { property("gen1") = forAll { (person:…
David Portabella
  • 12,390
  • 27
  • 101
  • 182
0
votes
1 answer

Acquiring 2 implicits for scalacheck function

I am using scalacheck and am in the middle of a generic-programming soup right now. The official guide shows this example: def matrix[T](g: Gen[T]): Gen[Seq[Seq[T]]] = Gen.sized { size => val side = scala.math.sqrt(size).asInstanceOf[Int] …
Felix
  • 8,385
  • 10
  • 40
  • 59
1 2 3
18
19