When examining the test coverage of a package, it is useful to know if there are any locations where there is 0 test coverage.
Arguments
- x
a coverage object returned
package_coverage()- ...
additional arguments passed to
tally_coverage(), such asby = "function"to list the functions that were never run.
Examples
cov <- code_coverage(
"f <- function(x) {\n if (x) 'yes' else 'no'\n}\ng <- function() 1",
"f(TRUE)"
)
zero_coverage(cov)
#> filename functions line value
#> 1 /tmp/RtmpvpKgL4/source.R190e50d1ff5a f 2 0
#> 2 /tmp/RtmpvpKgL4/source.R190e50d1ff5a g 4 0
zero_coverage(cov, by = "function")
#> filename functions first_line last_line value
#> 2 /tmp/RtmpvpKgL4/source.R190e50d1ff5a g 4 4 0
