鉴于代码:
public void foo(int age,boolean smart) {
if (age>18 && smart) { // <--- This is the part that should be covered
doSomething()
}
}
Run Code Online (Sandbox Code Playgroud)
使用JUnit我测试foo(15,true)和foo(25,true)
IntelliJ将报告条件行已完全覆盖(绿色),但事实并非如此.
在使用Jacoco的Eclipse中,线条被正确标记为部分覆盖,条件为黄色.
IntelliJ是否有办法在条件级别进行覆盖?