scala - Is there a better way to check if a number should be inside a range, in scalatest? -
say wanna check if result (an integer) should >=4
, <=15
, can write such assertion in scalatest test:
assert(num >= 4) assert(num <= 15)
it works can improved in opinion. there better way check in scalatest?
this maybe: assert(4 5 contains res.toint)
?
Comments
Post a Comment