Skip to content

Instantly share code, notes, and snippets.

@noelmarkham
Last active August 29, 2015 14:11
Show Gist options
  • Save noelmarkham/021040558016f517199f to your computer and use it in GitHub Desktop.
Save noelmarkham/021040558016f517199f to your computer and use it in GitHub Desktop.
Scalacheck generated functions return the same output for any input
scala> import org.scalacheck._
import org.scalacheck._
scala> val generatedFunc = Gen.resultOf[String => Int, String => Int](identity).sample.get
generatedFunc: String => Int = <function1>
scala> generatedFunc("hello") == generatedFunc("goodbye")
res0: Boolean = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment