testwhat (version 4.2.2)

test_predefined_objects: Test predefined R objects

Description

At the start of your SCT, you typically want to check whether some predefined variables are still correct. test_predefined_object allows you to specify a vector of object names, together with a vector of equivalence conditions, evaluation specifications, undefined an incorrect messages. As such, test_predefined_objects is a vectorized wrapper around test_object with meaningful defeault feedback messages that tell the student to not adapt predefined objects and code in the sample code.

Usage

test_predefined_objects(name, eq_condition = "equivalent", eval = TRUE, undefined_msg = NULL, incorrect_msg = NULL)

Arguments

name
vector of names of the objects to check
eq_condition
vector version of eq_condition of test_object.
eval
vector version of eval of test_object.
undefined_msg
vector version of undefined_msg of test_object
incorrect_msg
vector version of incorrect_msg of test_object

Examples

Run this code
## Not run: 
# # Suppose the sample code specifies the variables a, b and c, 
# # and you want to check that a, b and c haven't changed.
# test_predefined_objects(c("a", "b", "c"))
# ## End(Not run)

Run the code above in your browser using DataCamp Workspace