View source: R/expectations_xl.R
expect_equal_xl | R Documentation |
Building on the tinytest functions for testing equality with optional enhanced object diffing and additional test feedback through addtional attributes.
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"), ... )
current |
|
target |
|
useDiffObj |
|
tol |
|
info |
An additional attribute to pass around with the tinytest object |
mode |
|
format |
|
... |
Passed to |
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.
A tinytest
object. A tinytest object is a
logical
with attributes holding information about the
test that was run
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.