expect_equal_with_diff {ttdo} | R Documentation |
Test for equality with explicit difference
Description
Test for equality with explicit difference
Usage
expect_equal_with_diff(
current,
target,
tol = sqrt(.Machine$double.eps),
mode = getOption("diffobj.mode", "unified"),
format = getOption("diffobj.format", "ansi256"),
...
)
expect_equivalent_with_diff(
current,
target,
tol = sqrt(.Machine$double.eps),
...
)
Arguments
current |
|
target |
|
tol |
|
mode |
|
format |
|
... |
Passed to |
Details
expect_equivalent_with_diff
calls
expect_equal_with_diff
with the extra arguments
check.attributes=FALSE
and use.names=FALSE
Value
A tinytest
object. A tinytest object is a
logical
with attributes holding information about the
test that was run
Examples
library(tinytest)
using(ttdo)
expect_equal_with_diff(1 + 1, 2) # TRUE
expect_equal_with_diff(1 - 1, 2) # FALSE
expect_equivalent_with_diff(2, c(x=2)) # TRUE
expect_equivalent_with_diff(2, c(x=2)) # TRUE