lifecycle::badge("experimental")
RStudio Addin:
Inserts code for initializing and reporting a
checkmate assert collection
.
See `Details`
for how to set a key command.
assertCollectionAddin(add_comments = TRUE, insert = TRUE, indentation = NULL)
Inserts the following (excluding the ----
):
----
# Check arguments ####
assert_collection <- checkmate::makeAssertCollection()
# checkmate::assert_ , add = assert_collection)
checkmate::reportAssertions(assert_collection)
# End of argument checks ####
----
Returns NULL
invisibly.
Whether to add comments around. (Logical)
This makes it easy for a user to create their own addin without the comments.
Whether to insert the code via
rstudioapi::insertText()
or return it. (Logical)
N.B. Mainly intended for testing the addin programmatically.
Indentation of the code. (Numeric)
N.B. Mainly intended for testing the addin programmatically.
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
After installing the package. Go to:
Tools >> Addins >> Browse Addins >> Keyboard Shortcuts
.
Find "Insert checkmate AssertCollection Code"
and press its field under Shortcut
.
Press desired key command, e.g. Alt+C
.
Press Apply
.
Press Execute
.
Other addins:
dputSelectedAddin()
,
initializeGXSFunctionAddin()
,
initializeTestthatAddin()
,
insertExpectationsAddin()
,
navigateTestFileAddin()
,
wrapStringAddin()