1
我試圖用「應該」與邏輯「或」運算符沿功能(例如)如下:如何在scala中使用符合邏輯的'OR'運算符?
def String(x :Integer) :Integer ={
/*----------------
-----------------*/
return value;
}
String.value.size should be (8) || String.value.size should be (0) /*that is anything other than the value 8 or 0 should cause a false and the program should start execution */
,但我得到一個錯誤說「值||不是成員org.scalatest.matchers.Matcher [Any]「
有人可以幫我在這裏。提前致謝..
你不應該這樣做!你的測試需要確定性 –