Feature #22014
openSupport `||` and `&&` operations in coverage
Description
https://bugs.ruby-lang.org/issues/13901 added support for branch coverage, but did not include || and && branches
i.e.
def self.even_and_positive(number)
number.even? && number >= 0
end
Currently, this is considered to be 100% covered so long as it is executed, even though some values won't result in the right hand check being executed.
From the comments on the original ticket, it sounds like || and && were planned to be supported:
https://bugs.ruby-lang.org/issues/13901?tab=history#note-6
marcandre:
I imagine you are planning on covering ||, &&, &. and ? :, right?https://bugs.ruby-lang.org/issues/13901?tab=history#note-7
mame:
? : has been already supported. Yuichiro has experimentally implemented &. coverage. I think we should support || and && too.
(Formerly, I had no intention of supporting them, but Yuichiro implemented column numbers, so now we will be able to do that.)
So I'm hoping this is just something that got forgotten about rather than having a particular unsolved technical challenge.
Related: https://github.com/simplecov-ruby/simplecov/issues/921
No data to display