scalaprops
scalaprops copied to clipboard
property based testing library for Scala
scalaprops
property based testing library for Scala
features
- real
scala.FunctionNgenerators usingCogen(aka CoArbitrary in QuickCheck). scalaprops can generate not only constant Functions - flexible parameter settings for each test( ScalaCheck doesn't have this feature )
- timeout as soon as possible
- flexible law checking like discipline
- discipline uses only
Stringfor test id. but scalaprops can use other thanString - scalaz integration
- laws for scalaz typeclasses
GenandCogeninstances of scalaz datatypes- immutable random number generator
- scalaprops does not use
scala.util.Randombecausescala.util.Randomis mutable - default implementation is Mersenne Twister (JVM, scala-native) or Tiny Mersenne Twister (Scala.js)
- Scala.js support
- scala-native support. see https://github.com/scalaprops/scalaprops-native-example
- deterministic testing
latest stable version
please use sbt plugin because there are some convenient features.
setup without sbt plugin
testFrameworks += new TestFramework("scalaprops.ScalapropsFramework")
parallelExecution in Test := false // currently, does not support parallel execution
libraryDependencies += "com.github.scalaprops" %% "scalaprops" % "0.9.0" % "test"
libraryDependencies += "com.github.scalaprops" %% "scalaprops-scalaz" % "0.9.0" % "test"

deterministic testing
Scalaprops emitting which seed it started with during a failing test, and providing an interface --seed=<value> for re-running the failing test with the same seed.

examples
See scalaprops-example project.