#' This function is for students.
#' It shows the testing results a more understandable way.
#' @export
test_functions <- function() {
table <- test_env_functions()
for(function_name in names(table)){
cases <- table[[function_name]]
if (all(cases == TRUE)) {
cat("Testing: ", function_name, "...passed!", sep = "")
} else {
failing_id <- which(cases == FALSE)[1]
failing_case <- test_cases[[function_name]][failing_id]
cat(
"Testing: ", function_name, "...uh oh,\n\t",
function_name, " failed on the following test case:\n\t",
unlist(failing_case), sep = "")
}
cat("\n\n")
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.