which resulted in 100% coverage. Can I please know what is wrong with first or second code pattern? why would it say that the else path was not taken, even though there are 'hits' on those lines of code? is this a bug or by design? Though I can somewhat digest the first one, I would say the second one is a real bug!
(I have cut many things inside the braces in the images to simplify stuff, the code given is the (pseudo)real one)
Hello
I ran into a weird issue: when I have the following setup,
It reported that
else path is not
taken:I am testing the else part too, by asserting
doSomething
is called. I refactored the code to the following:which ended up with following report:
Once again I refactored the code:
which resulted in 100% coverage. Can I please know what is wrong with first or second code pattern? why would it say that the else path was not taken, even though there are 'hits' on those lines of code? is this a bug or by design? Though I can somewhat digest the first one, I would say the second one is a real bug!
(I have cut many things inside the braces in the images to simplify stuff, the code given is the (pseudo)real one)