Skip to content

Instantly share code, notes, and snippets.

@gigiigig
Created June 30, 2015 11:54
Show Gist options
  • Save gigiigig/c78d0b9d21334fbad509 to your computer and use it in GitHub Desktop.
Save gigiigig/c78d0b9d21334fbad509 to your computer and use it in GitHub Desktop.
Automatic generate random case classes with shapless-scalacheck
import shapeless._, contrib.scalacheck._
import org.scalacheck._
import org.scalacheck.Properties
import org.scalacheck.Prop.forAll
object console extends Properties("ciao") {
case class Foo(i: Int, s: String)
property("some property about Foo") = {
forAll { foo: Foo =>
println(s"foo: ${foo}")
1 == 1
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment