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