expect_equal {tinytest} | R Documentation |
Express expectations
expect_equal(current, target, tol = sqrt(.Machine$double.eps), ...) expect_identical(current, target) expect_equivalent(current, target, tol = sqrt(.Machine$double.eps), ...) expect_true(current) expect_false(current) expect_error(current, pattern = ".*") expect_warning(current, pattern = ".*")
current |
|
target |
|
tol |
|
... |
Passed to |
pattern |
|
expect_equivalent
calls expect_equal
with the extra
arguments check.attributes=FALSE
and use.names=FALSE
A tinytest
object. A tinytest object is a
logical
with attributes holding information about the
test that was run
Each expect_haha
function can also be called as checkHaha
.
Although the interface is not entirely the same, it is expected that
this makes migration from the RUnit
framework a little easier, for those
who wish to do so.
Other test-functions: ignore
expect_equal(1 + 1, 2) # TRUE expect_equal(1 - 1, 2) # FALSE expect_equivalent(2, c(x=2)) # TRUE expect_equal(2, c(x=2)) # FALSE