tinytest {tinytest}R Documentation

Tinytest constructor

Description

Each individual test in the package generates a tinytest object. A tinytest object is a logical scalar, with metadata (attributes) about the test.

Usage

tinytest(
  result,
  call,
  trace = NULL,
  diff = NA_character_,
  short = c(NA_character_, "data", "attr", "xcpt", "envv", "wdir", "file", "lcle"),
  info = 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

info

[character] other information, to be printed in the long message

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.

Details

The result can take three values.

Authors of extension packages should not use NA as a result value as this part of the interface may change in the future.

See Also

Other extensions: register_tinytest_extension(), using()

Examples

tt <- expect_equal(1+1, 2)
if (isTRUE(tt)){
  print("w00p w00p!")
} else {
  print("Oh no!")
}




[Package tinytest version 1.4.1 Index]