check: Apply passif/failif/okif tests to an identified code object

Description Usage Arguments Value Examples

Description

A generic testing function for applying passif/failif tests with V and EX bindings to a checkr_result object. Unlike line_where(), other line functions, no patterns need to be provided. Just the passif/failif tests.

Usage

1
check(ex, ..., message = "Sorry!")

Arguments

ex

the checkr_result object with a single line of code

...

passif/failif tests to be applied

message

a character string to be used as the message for a failed result

Value

a checkr_result object reflecting the outcome of the tests

Examples

1
2
3
4
code <- for_checkr(quote({x <- 3; y <- x^2 + 2}))
line2 <- line_where(code, insist(Z == "y"))
check(line2, passif(V == 11, "Right, eleven!"),
      message = "Sorry. The result should be 11.")

dtkaplan/checkr documentation built on May 15, 2019, 4:59 p.m.