Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arbitrary instance for Option[A] does not have good coverage. #75

Closed
j3h opened this issue Nov 15, 2013 · 4 comments
Closed

Arbitrary instance for Option[A] does not have good coverage. #75

j3h opened this issue Nov 15, 2013 · 4 comments

Comments

@j3h
Copy link
Contributor

j3h commented Nov 15, 2013

Since the Arbitrary instance for Option[A] will only generate None when size is zero, it's easy to write passing tests that should fail:

scala> import org.scalacheck.Prop.forAll
import org.scalacheck.Prop.forAll

scala> (forAll { (x: Option[Int], y: Option[Int]) => x.isDefined == y.isDefined }).check
+ OK, passed 100 tests.
@tonymorris
Copy link
Contributor

Holy moly, this is not good. Got a patch?

@j3h
Copy link
Contributor Author

j3h commented Nov 15, 2013

Just found this. Working on it.

@tonymorris
Copy link
Contributor

Coolo. Thanks for being awesome.

@j3h
Copy link
Contributor Author

j3h commented Nov 15, 2013

I accidentally duplicated this with issue #76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants