ok(ut_cmp_error({
stop("Hammer time")
}, "hammer", ignore.case = TRUE), "Returned a hammer-based error")
ok(ut_cmp_error({
stop(errorCondition("Hammer time", class = "MC"))
}, expected_mesage = "Hammer", expected_class = "MC"), "Returned a MC Hammer based error")
# \dontshow{
# Clear unittest result log, so our unittest failues don't fail example-building
unittest:::clear_outcomes()
# }
Run the code above in your browser using DataLab