【发布时间】:2021-06-24 16:54:31
【问题描述】:
有没有办法显示更好的错误信息?比如下面的代码
it should "check that items satisfy predicate" in {
List(1,2,3,4,5,6).forall(x => x < 5) should equal (true)
}
只给我以下错误,没有任何描述:
“假不等于真”
谓词不仅可以是least 表达式,还可以是任何其他函数。对于least,我找到了https://www.scalatest.org/user_guide/using_matchers#inspectorShorthands。
【问题讨论】: