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

Comments

Projects
None yet
2 participants
@j3h
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

This comment has been minimized.

Collaborator

tonymorris commented Nov 15, 2013

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

@j3h

This comment has been minimized.

Contributor

j3h commented Nov 15, 2013

Just found this. Working on it.

@tonymorris

This comment has been minimized.

Collaborator

tonymorris commented Nov 15, 2013

Coolo. Thanks for being awesome.

@j3h

This comment has been minimized.

Contributor

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