expect_length {testthat} | R Documentation |
Expectation: does a vector have the specified length?
expect_length(object, n)
object |
object to test |
n |
Expected length. |
Other expectations: comparison-expectations
,
equality-expectations
,
expect_equal_to_reference
,
expect_match
, expect_named
,
inheritance-expectations
,
logical-expectations
,
output-expectations
expect_length(1, 1) expect_length(1:10, 10) ## Not run: expect_length(1:10, 1) ## End(Not run)