I was trying to use the "should be" function along with the logical "OR" operator as follows (for example) :
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 */
But I get an error saying "value || is not a member of org.scalatest.matchers.Matcher[Any]"
Can somebody help me here. Thank you in advance..
From the error message, it looks like String.value.size should be (8)
returns an instance of org.scalatest.matchers.Matcher
which does not have a member ||
. According to this you should use or
for disjunction e.g.
String.value.size should (be (8) or be (0))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With