| 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_reference,
expect_equal_to_reference;
equals, expect_equal;
expect-compare,
expect_less_than,
expect_more_than,
is_less_than, is_more_than;
expect_error, throws_error;
expect_false, expect_true,
is_false, is_true;
expect_identical,
is_identical_to; expect_is,
is_a; expect_match,
matches; expect_message,
shows_message; expect_named,
has_names; expect_null,
is_null; expect_output,
prints_text; expect_warning,
gives_warning;
takes_less_than
a <- b <- 1:3 names(b) <- letters[1:3] expect_equivalent(a, b)