all.equal.condition

0th

Percentile

Compare Conditions

Tests that issue warnings or `stop` produce condition objects. The functions documented here are specialized versions of all.equal designed specifically to compare conditions and condition lists produced during unitizer test evaluations. conditionList objects are lists of conditions that come about when test expressions emit multiple conditions (e.g. more than one warning).

Usage
# S4 method for conditionList,ANY
all.equal(target, current, ...)

# S3 method for equal.conditionList all(target, current, ...)

# S3 method for equal.condition all(target, current, ...)

Arguments
target

the list of conditions that we are matching against

current

the list of conditions we are checking

...

provided for compatibility with generic

Details

condition objects produced by tests have one additional attributed “printed” which disambiguates whether a condition was the result of the test expression, or the print / show method used to display it to screen.

For conditionList objects, these methods only return TRUE if all conditions are pairwise all.equal.

Value

TRUE if the (lists of) conditions are equivalent, a character vector explaining why they are not otherwise

Aliases
  • all.equal.condition
  • all.equal,condition,ANY-method
  • all.equal,conditionList,ANY-method
  • all.equal.conditionList
  • all.equal.condition
Examples
# NOT RUN {
cond.1 <- simpleWarning('hello world')
cond.2 <- simpleError('hello world')
cond.3 <- simpleError('goodbye world')
all.equal(cond.1, cond.1)
all.equal(cond.1, cond.2)
all.equal(cond.2, cond.3)
## Normally you would never actually create a `conditionList` yourself; these
## are automatically generated by `unitizer` for review at the `unitizer`
## prompt
all.equal(
  conditionList(.items=list(cond.1, cond.2)),
  conditionList(.items=list(cond.1, cond.3))
)
# }
Documentation reproduced from package unitizer, version 1.4.5, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.