小编ygu*_*ygu的帖子

在Propspec和PropertyCheck中使用scalacheck时,如何让ScalaTest正确报告测试结果?

我想使用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)

eclipse scala scalatest scalacheck

6
推荐指数
1
解决办法
893
查看次数

标签 统计

eclipse ×1

scala ×1

scalacheck ×1

scalatest ×1