testthat (version 1.0.2)

expect_length: Expectation: does a vector have the specified length?

Description

Expectation: does a vector have the specified length?

Usage

expect_length(object, n)

Arguments

object
object to test
n
Expected length.

See Also

Other expectations: comparison-expectations, equality-expectations, expect_equal_to_reference, expect_match, expect_named, inheritance-expectations, logical-expectations, output-expectations

Examples

Run this code
expect_length(1, 1)
expect_length(1:10, 10)

expect_length(1:10, 1)

Run the code above in your browser using DataLab