% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/covr.R
\name{function_coverage}
\alias{function_coverage}
\title{Calculate test coverage for a specific function.}
\usage{
function_coverage(fun, code = NULL, env = NULL, enc = parent.frame())
}
\arguments{
\item{fun}{name of the function.}

\item{code}{expressions to run.}

\item{env}{environment the function is defined in.}

\item{enc}{the enclosing environment which to run the expressions.}
}
\description{
Calculate test coverage for a specific function.
}
\examples{
add <- function(x, y) { x + y }
function_coverage(fun = add, code = NULL) # 0\% coverage
function_coverage(fun = add, code = add(1, 2) == 3) # 100\% coverage
}
