Reduce number of HamcrestError instance by simply failing the match
Opened this issue · 0 comments
imbenjamin commented
Where we can replace HamcrestError
instances with just simply return false
, minimising the number of code stops and respecting the Boolean return value:
- brsHamcrest_CollectionMatchers.brs // inCollection()
- brsHamcrest_CoreMatchers.brs // isNot()
- brsHamcrest_CoreMatchers.brs // allOf()
- brsHamcrest_CoreMatchers.brs // anyOf()
- brsHamcrest_CoreMatchers.brs // noneOf()
- brsHamcrest_Assert.brs // assertThat()
- brsHamcrest_Matcher.brs // BaseMatcher()
Perhaps an error should still be logged (and remove the stop
from HamcrestError
), and continue to execute code, returning the false value.