tinytest {tinytest} | R Documentation |
Each individual test in the package generates a tinytest
object. A
tinytest
object is a logical
scalar, with metadata
(attributes) about the test.
tinytest(result, call, diff = NA_character_, short = NA_character_, info = NA_character_, file = NA_character_, fst = NA_integer_, lst = NA_integer_, ...)
result |
|
call |
|
diff |
|
short |
|
info |
|
file |
|
fst |
|
lst |
|
A tinytest
object.
The result can take three values.
TRUE
: test was passed.
FALSE
: test was failed.
NA
: A side effect was detected.
Authors of extension packages should not use NA
as a result value as
this part of the interface may change in the future.
Other extensions: register_tinytest_extension
,
using
tt <- expect_equal(1+1, 2) if (isTRUE(tt)){ print("w00p w00p!") } else { print("Oh no!") }