Issue #15463 has been reported by grosser (Michael Grosser).

----------------------------------------
Feature #15463: oneshot coverage does not allow counting code lines without coverage
https://bugs.ruby-lang.org/issues/15463

* Author: grosser (Michael Grosser)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Problem:
I'm using https://github.com/grosser/single_cov to alert when uncovered lines where added to the codebase after each test run.

I'd love to use oneshot coverage for that to make it faster, but noticed that this does not work since there is no way to find out which lines of a given files are uncovered.

My naive implementation failed https://github.com/grosser/single_cov/pull/17 since to know what uncovered lines are I need to know which lines ruby considers code,
otherwise I'd be alerting on comments etc that are uncovered.

Example: loading this file would result in oneshot coverage of [2], loading an executing would result on [2,3]
but since I don't have a way of knowing that line 3 is code and supposed to be covered, I cannot show it as uncovered code.

~~~
# Foo <- not code and not covered = OK
def a <- code and covered = OK
1 <- code and not covered = FAIL
end <- not code and not covered = OK
~~~

Solutions:
 - oneshot could be implemented as true/false/nil array for covered, uncovered, no-code (maybe oneshot_lines: :full)
 - oneshot could resturn the same hash as regular coverage, but with only 1/0 (maybe oneshot_lines: :hash)



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>