1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/expect-length.R
\name{expect_length}
\alias{expect_length}
\title{Does code return a vector with the specified length?}
\usage{
expect_length(object, n)
}
\arguments{
\item{object}{Object to test.
Supports limited unquoting to make it easier to generate readable failures
within a function or for loop. See \link{quasi_label} for more details.}
\item{n}{Expected length.}
}
\description{
Does code return a vector with the specified length?
}
\examples{
expect_length(1, 1)
expect_length(1:10, 10)
\dontrun{
expect_length(1:10, 1)
}
}
\seealso{
\code{\link[=expect_vector]{expect_vector()}} to make assertions about the "size" of a vector
Other expectations:
\code{\link{comparison-expectations}},
\code{\link{equality-expectations}},
\code{\link{expect_error}()},
\code{\link{expect_match}()},
\code{\link{expect_named}()},
\code{\link{expect_null}()},
\code{\link{expect_output}()},
\code{\link{expect_reference}()},
\code{\link{expect_silent}()},
\code{\link{inheritance-expectations}},
\code{\link{logical-expectations}}
}
\concept{expectations}
|