50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


tinytest (version 0.9.4)

tinytest: Tinytest constructor

Description

Each individual test in the package generates a tinytest object. A tinytest object behaves like a logical scalar, but it is endowed with attributes allowing to trace back where the test was run.

Usage

tinytest(result, call, diff = NA_character_, short = NA_character_,
  file = NA_character_, fst = NA_integer_, lst = NA_integer_, ...)

Arguments

result

[logical] scalar.

call

[call] The call that created result.

diff

[character] difference between current and target value (if any).

short

[character] short description of the difference

file

[character] File location of the test.

fst

[integer] First line number in the test file.

lst

[integer] Last line number in the test file (differs from fst if the call spans multiple lines).

Value

A tinytest object.

Examples

Run this code
# NOT RUN {
tt <- expect_equal(1+1, 2)
if (isTRUE(tt)){
  print("w00p w00p!")
} else {
  print("Oh no!")
}



# }

Run the code above in your browser using DataLab