I'd like to test my scala program using property based testing with scalacheck. I wrote :
class MyProperties extends PropSpec with PropertyChecks {
property("My property") {
val myProperty: org.scalacheck.Prop = new MyProperty
// some code I need to set myProperty
myProperty.check
}
}
But this seems wrong since when I run this class using ScalaTest, I get in the Console :
Run starting. Expected test count is: 1
MyProperties:
! Falsified after 51 passed tests.
> ARG_0: myGeneratedArgument
- My property
Run completed in 1 second, 623 milliseconds.
Total number of tests run: 1
Suites: completed 1, aborted 0
Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0
All tests passed.
So the problem is: my property is falsified, but the test passes !?! Does someone see what's wrong with my code ?
Thanks...
EDIT: I tried to call myProperty instead of myProperty.check, but this is not much better, cause this way, generators seem to be ignored (only one test is launched instead of a hundred).