A set of predicates and assertions for checking the properties of code. This is mainly for use by other package developers who want to include run-time testing features in their own packages. End-users will usually want to use assertive directly.
A set of predicates and assertions for checking the properties of code. Most of the documentation is on the assertive page. End-users will usually want to use assertive directly.
To install the stable version, type:
To install the development version, you first need the devtools package.
Then you can install the assertive.code package using
is_binding_locked checks to see if a variable has had its binding locked (that is, has been made read-only).
is_debugged checks to see if a function has a debugging flag set on it.
try, running the code and returning
TRUE if no error was thrown. (The results of running the code are also returned in an attribute.)
is_existing checks to see if a variable exists in a given environment.
is_if_condition checks if a variable is suitable for use as an if condition (that is, it is
is_loaded checks whether or not a DLL (shared object) has been loaded.
is_valid_r_code checks whether a string is valid (parseable) R code.
is_valid_variable_name checks whether a string is a valid R variable name.
Predicates that return a vector have two corresponding assertions. For example,
Predicates returning a single logical value have one corresponding assertion.
0.0-3 Drop dependency on devtools::with_envvar(). 0.0-1 Content extracted from assertive 0.3-0, and tidied.