Why does a Scalacheck Prop value not get evaluated?
问题 The official scalacheck documentation gives the following example: property("stringLength") = Prop.forAll { s: String => val len = s.length (s+s).length == len+len } I read that this can also be written as: val stringLength = Prop.forAll { s: String => val len = s.length (s+s).length == len+len } How can I run the second form of test code? When I execute sbt test , nothing happens with the second version. 回答1: The problem is that the second version is simply declaring a val that holds a