Tnx Jochen for the comment :-)
I've created the issue in Groovy JIRA:
https://issues.apache.org/jira/browse/GROOVY-10878
On 09.12.22 11:51, Damir Murat wrote:
[...]
simple assert
statement like
assert firstName != null
Groovy generates something like
ValueRecorder var1 = new ValueRecorder();
try {
String var1 = this.firstName;
var1.record(var1, 8);
I forgot to explicitly mention the primary motivation for doing this.
At the moment, there is no way to have full branch coverage for Groovy assert
statements.
In a larger project, this is very distractive when trying to find the pieces of
actual logic that
should be better covered with tests.
JaCoCo has long-standing issues with covering calls of methods that throw
exceptions.
When such methods are called inside of, if/else branches for example, the
result is
partial coverage reported for those branches.
However, there is a JaCoCo idiom