is_equivalent_to {testthat} | R Documentation |
Expectation: is the object equivalent to a value? This expectation tests for equivalency: are two objects equal once their attributes have been removed.
is_equivalent_to(expected, label = NULL) expect_equivalent(object, expected, info = NULL, label = NULL, expected.label = NULL)
expected |
Expected value |
label |
For full form, label of expected object used
in error messages. Useful to override default (deparsed
expected expression) when doing tests in a loop. For
short cut form, object label. When |
object |
object to test |
info |
extra information to be included in the message (useful when writing tests in loops). |
expected.label |
Equivalent of |
Other expectations: equals
,
expect_equal
, expect_error
,
expect_false
,
expect_identical
, expect_is
,
expect_match
, expect_message
,
expect_output
, expect_true
,
expect_warning
,
gives_warning
, is_a
,
is_false
, is_identical_to
,
is_true
, matches
,
prints_text
, shows_message
,
takes_less_than
, throws_error
a <- b <- 1:3 names(b) <- letters[1:3] expect_that(a, is_equivalent_to(b, label = b)) expect_equivalent(a, b)