expect_length: Check length of an object

View source: R/expectations.R

expect_lengthR Documentation

Check length of an object

Description

Check length of an object

Usage

expect_length(current, length, info = NA_character_, ...)

Arguments

current

[object] An R object with a length

length

[integer] A nonnegative integer

info

[character] scalar. Optional user-defined message. Must be a single character string. Multiline comments may be separated by

...

Currently not used.

See Also

Other test-functions: expect_equal_to_reference(), expect_equal(), expect_match(), ignore()

Examples

expect_length(3:4, 2) # TRUE
expect_length(2:5, 1) # FALSE


tinytest documentation built on March 7, 2023, 7:43 p.m.