【发布时间】:2018-06-22 05:55:25
【问题描述】:
这个让我发疯。以下属性测试以 scalatest 方式通过(使用“sbt test”目标)。
import org.scalatest.FlatSpec
import org.scalatest.prop.PropertyChecks
class FigaroCheckSpec extends FlatSpec with PropertyChecks {
"this property" should "fail" in { forAll { (p :Int) => false } }
}
为什么?我尝试了 FlatSpec 和 FreeSpec。当我直接将 Checkers 与 scalacheck API 一起使用时,它也可以工作(即失败)。
【问题讨论】:
标签: scala scalatest scalacheck