Skip to content

Instantly share code, notes, and snippets.

@dmyersturnbull
Last active April 3, 2016 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmyersturnbull/0ed3ee958c2d95edffc8273de90385b6 to your computer and use it in GitHub Desktop.
Save dmyersturnbull/0ed3ee958c2d95edffc8273de90385b6 to your computer and use it in GitHub Desktop.
A tiny example of using ScalaCheck and ScalaTest together.
import org.scalacheck.Gen
import org.scalatest.{PropSpec, Matchers}
import org.scalatest.prop.PropertyChecks
class MinimalScalaCheckExample extends PropSpec with PropertyChecks with Matchers {
property("A string's length should be constant") {
forAll { (s: String) =>
s.length should equal(s.length)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment