Learn R Programming

testthat (version 0.3)

is_equivalent_to: Expectation: is the object equivalent to a value?

Description

Expectation: is the object equivalent to a value? This expectation tests for equivalency: are two objects equal once their attributes have been removed.

Usage

is_equivalent_to(expected, label)

Arguments

expected
expected value
label
label of expected object used in error messages. Useful to override default (deparsed expected expression) when doing tests in a loop.

Examples

Run this code
a <- b <- 1:3
names(b) <- letters[1:3]
expect_that(a, is_equivalent_to(b, label = b))
expect_equivalent(a, b)

Run the code above in your browser using DataLab