assertive.code v0.0-3

0

Monthly downloads

0th

Percentile

Assertions to Check Properties of Code

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.

Readme

Project Status: Active - The project has reached a stable, usable state and is being actively developed. Is the package on CRAN? Build Status AppVeyor Build Status Research software impact

assertive.code

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.

Installation

To install the stable version, type:

install.packages("assertive.code")

To install the development version, you first need the devtools package.

install.packages("devtools")

Then you can install the assertive.code package using

library(devtools)
install_bitbucket("richierocks/assertive.code")

Predicates

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.

is_error_free, wraps 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 TRUE or FALSE).

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.

Assertions

Predicates that return a vector have two corresponding assertions. For example, is_valid_variable_name has assert_all_are_valid_variable_names and assert_any_are_valid_variable_names.

Predicates returning a single logical value have one corresponding assertion. For example, is_debugged has assert_is_debugged.

Functions in assertive.code

Name Description
assert_is_binding_locked Is the binding of a variable locked?
assert_has_arg Does the current call have an argument?
assert_all_are_valid_variable_names Is the string a valid variable name?
assert_is_debugged Is the input function being debugged?
is_error_free Does the code run without throwing an error?
assert_all_are_existing Does the variable exist?
assert_is_loaded Is the input a symbol in a loaded DLL?
assert_is_if_condition Is suitable to be used as an if condition
assert_is_valid_r_code Is the input valid R code?
No Results!

Last month downloads

Details

Type Package
Date 2018-10-21
URL https://bitbucket.org/richierocks/assertive.code
BugReports https://bitbucket.org/richierocks/assertive.code/issues
License GPL (>= 3)
LazyLoad yes
LazyData yes
Acknowledgments Development of this package was partially funded by the Proteomics Core at Weill Cornell Medical College in Qatar . The Core is supported by 'Biomedical Research Program' funds, a program funded by Qatar Foundation.
Collate 'imports.R' 'assert-is-code.R' 'is-code.R'
RoxygenNote 6.1.0
NeedsCompilation no
Packaged 2018-10-21 18:26:19 UTC; richierocks
Repository CRAN
Date/Publication 2018-10-21 19:00:02 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/assertive.code)](http://www.rdocumentation.org/packages/assertive.code)