我想使用scalacheck使用基于属性的测试来测试我的scala程序.我写 :
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
}
}
Run Code Online (Sandbox Code Playgroud)
但这似乎是错的,因为当我使用ScalaTest运行这个类时,我进入控制台:
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 …Run Code Online (Sandbox Code Playgroud)