Learn R Programming

covr (version 4.0.0)

zero_coverage: Provide locations of zero coverage

Description

When examining the test coverage of a package, it is useful to know if there are any locations where there is 0 test coverage.

Usage

zero_coverage(x, ...)

Value

A data.frame with coverage data where the coverage is 0.

Arguments

x

a coverage object returned package_coverage()

...

additional arguments passed to tally_coverage(), such as by = "function" to list the functions that were never run.

Details

if used within RStudio this function outputs the results using the Marker API.

Examples

Run this code
cov <- code_coverage(
  "f <- function(x) {\n  if (x) 'yes' else 'no'\n}\ng <- function() 1",
  "f(TRUE)"
)
zero_coverage(cov)
zero_coverage(cov, by = "function")

Run the code above in your browser using DataLab