Bringing this from Issues to the forum.
Steps to reproduce
public class Utils {
public static boolean isNotNullOrEmpty(Map map) {
return map != null && !map.isEmpty();
}
public static boolean isNotNullOrEmpty(Set set) {
return set != null && !set.isEmpty();
}
}
For which I wrote a unit tests as follows -
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class UtilsTest {
@Test
void testUtils() {
assertNotNull(new Utils());
assertFalse(Utils.isNotNullOrEmpty(new HashMap()), "Map utils
failure.");
assertFalse(Utils.isNotNullOrEmpty(new HashSet()), "Set utils
failure.");
}
}
JaCoCo version:0.7.9
Operating system:MacOSX
Tool integration: Maven
Expected behaviour
The coverage for the isNotNullOrEmpty(Set set) should also be 100%.
Actual behaviour
The branch coverage is 50%.
External Link -
http://stackoverflow.com/questions/43264560/jacoco-code-coverage-difference-for-set-and-map
Why is there such an incosistency for Set vs Map util defined in our code.
--
You received this message because you are subscribed to the Google Groups
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/9c1b7e16-0f60-4913-9735-acf77df300cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.