Retrieve Test Contents From Test Item

Intended for use within the unitizer interactive environment, allows user to retrieve whatever portions of tests are stored by unitizer.

# S4 method for unitizerItem
$(x, name)

# S4 method for unitizerItem,ANY [[(x, i, j, ..., exact = TRUE)


a unitizerItem object, typically .NEW or .REF at the unitizer interactive prompt


a valid test sub-component


a valid test sub-component as a character string, or a sub-component index


missing for compatibility with generic


missing for compatibility with generic


unused, always matches exact


Currently the following elements are available:

  • call the call that was tested as an unevaluated call, but keep in mind that if you intend to evaluate this for a reference item the environment may not be the same so you could get different results (ls will provide more details)

  • value the value that results from evaluating the test, note this is equivalent to using .new or .ref; note that the value is displayed using desc when viewing all of .NEW or .REF

  • output the screen output (i.e. anything produced by cat/print, or any visible evaluation output) as a character vector

  • message anything that was output to stderr, mostly this is all contained in the conditions as well, though there could be other output here, as a character vector

  • conditions a conditionList containing all the conditions produced during test evaluation

  • aborted whether the test call issues a restart call to the `abort` restart, as `stop` does.


the test component requested

  • $.unitizerItem
  • $,unitizerItem-method
  • [[,unitizerItem,ANY-method
## From the unitizer> prompt:
.NEW <- mock_item()  # .NEW is normally available at unitizer prompt
.NEW$value              # equivalent to `.new`
Documentation reproduced from package unitizer, version 1.4.2, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.