expect_equal_xl {ttdo} | R Documentation |
Extensions of equality tests for tinytest
Description
Building on the tinytest functions for testing equality with optional enhanced object diffing and additional test feedback through addtional attributes.
Usage
expect_equal_xl(
current,
target,
useDiffObj = TRUE,
tol = sqrt(.Machine$double.eps),
info = NA_character_,
mode = getOption("diffobj.mode", "unified"),
format = getOption("diffobj.format", "ansi256"),
...
)
expect_identical_xl(
current,
target,
useDiffObj = TRUE,
info = NA_character_,
mode = getOption("diffobj.mode", "unified"),
format = getOption("diffobj.format", "ansi256"),
...
)
expect_equivalent_xl(
current,
target,
useDiffObj = TRUE,
tol = sqrt(.Machine$double.eps),
info = NA_character_,
mode = getOption("diffobj.mode", "unified"),
format = getOption("diffobj.format", "ansi256"),
...
)
Arguments
current |
|
target |
|
useDiffObj |
|
tol |
|
info |
An additional attribute to pass around with the tinytest object |
mode |
|
format |
|
... |
Passed to |
Details
While tinytest does now support the passing of additional information with the info
field in its tests, they are not yet supported in the as.data.frame.tinytests
method.
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_xl(1 + 1, 2, score = 3) # TRUE
expect_equal_xl(1 - 1, 2, name = "check 1-1==2", score = 1, totalpts = 2) # FALSE