truth icon indicating copy to clipboard operation
truth copied to clipboard

Make Expect throw ComparisonFailure when possible

Open cpovirk opened this issue 5 years ago • 2 comments

Currently, it always throws AssertionError. But if there's only one failure and it's a ComparisonFailure, we should throw ComparisonFailure. Arguably we could throw ComparisonFailure even in the case of multiple failures, at least if only one input is a ComparisonFailure, though that's potentially confusing.

cpovirk avatar Apr 10 '19 19:04 cpovirk

Arguably we could throw ComparisonFailure even in the case of multiple failures, at least if only one input is a ComparisonFailure, though that's potentially confusing.

I forgot that there's MultipleFailuresError if we move to opentest4j (#333). That might help.

cpovirk avatar Apr 10 '19 19:04 cpovirk

There's also a MultipleFailuresException in JUnit 4. But it looks like that might be less supported by IDEs than MultipleFailuresError (which itself might not be heavily supported).

cpovirk avatar Apr 20 '20 18:04 cpovirk