scala 单元测试
字符串测试
ScalaTest
提供了很方便的测试字符串的工具, 这些工具可以进行正则表达式的测试,常用方法有:
val string = "test string"
string should startWith("test")
string should endWith("string")
string should not endWith("the end")
string should not include("down down")
string should include("st")
string should startWith regex("I.fel+")
string should endWith regex ("h.{4}r")
string should not endWith regex("\\d{5}")
string should