Note we could simply write the expression itself and let it error,
assert makes the intention of the code clearer
expression. This expression should not error.
additional arguments to
For testing the converse, there already is
1 2 3 4
assert(1 + 1) # This will throw no error. # stopifnot(is(tryCatch(error = identity, assert(not_existent)), 'error')) # The above will produce an error. In unit tests, it will be clear this # means "We expect no error to occur."
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.