What is the === (triple-equals) operator in Scala Koans?

拜拜、爱过 提交于 2019-11-30 04:10:38

This is the triple-equals operator from ScalaTest. Have a look at this page: Getting Started with FunSuite. It says:

ScalaTest lets you use Scala's assertion syntax, but defines a triple equals operator (===) to give you better error messages. The following code would give you an error indicating only that an assertion failed:

assert(1 == 2)

Using triple equals instead would give you the more informative error message, "1 did not equal 2":

assert(1 === 2)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!