ttdo_boolean_and_message_tests {ttdo} | R Documentation |
Extensions of boolean and messaging tests from tinytest
Description
Building on the tinytest functions for testing boolean values with additional test feedback through attributes.
Usage
expect_true_xl(current, info = NA_character_, ...)
expect_false_xl(current, info = NA_character_, ...)
expect_null_xl(current, info = NA_character_, ...)
expect_silent_xl(current, quiet = TRUE, info = NA_character_, ...)
expect_error_xl(
current,
pattern = ".*",
class = "error",
info = NA_character_,
...
)
expect_warning_xl(
current,
pattern = ".*",
class = "warning",
info = NA_character_,
strict = FALSE,
...
)
expect_message_xl(
current,
pattern = ".*",
class = "message",
info = NA_character_,
strict = FALSE,
...
)
Arguments
current |
|
info |
scalar. Optional user-defined message. Must be a single character string. Multiline comments may be separated by "\n". |
... |
Passed to |
quiet |
|
pattern |
|
class |
|
strict |
|
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_true_xl(TRUE, score = 3) # TRUE
expect_true_xl(FALSE, name = "check 1-1==2", score = 1, totalpts = 2) # FALSE