expect_equal_with_diff | R Documentation |
Test for equality with explicit difference
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),
...
)
current |
|
target |
|
tol |
|
mode |
|
format |
|
... |
Passed to |
expect_equivalent_with_diff
calls
expect_equal_with_diff
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. The class attribute is set to c("ttdo", "tinytest")
to signal that it is a 'diffobj' result.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.