ok(ut_cmp_warning({
warning("Wooooo!")
}, "^woo", ignore.case = TRUE), "Issued a haunting warning")
ok(ut_cmp_warning({
warning("Woooo!")
warning("Woooooo!")
}, "^Woo", expected_count = 2L), "Issued two haunting warnings")
ok(ut_cmp_warning({
warning("Woooo!")
warning("Boooo!")
}, c("^Woo", "^Boo"), expected_count = 2L), "Issued a haunting and a diapproving warning")
# \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