@@ -106,26 +106,28 @@ check_plan <- function(tests = test_db(), defaults = list(), timeout = getOption
106106 args <- as.list(sets_of_args [aa , , drop = FALSE ])
107107 args_tag <- paste(sprintf(" %s=%s" , names(args ), unlist(args )), collapse = " , " )
108108 msg <- NULL
109- if (status [aa ] == " OK" ) {
109+ if (status [aa ] == " OK" ) {
110110 cat(sprintf(" %s %s\n " , ok , args_tag ))
111- total [" OK" ] <- total [" OK" ] + 1L
112- } else if (status [aa ] == " ERROR" ) {
111+ total [" OK" ] <- total [" OK" ] + 1L
112+ } else if (status [aa ] == " ERROR" ) {
113113 cat(sprintf(" %s %s\n " , error , args_tag ))
114- total [" ERROR" ] <- total [" ERROR" ] + 1L
115- result <- test_results [[tt ]][[aa ]]
116- ex <- result $ error
114+ total [" ERROR" ] <- total [" ERROR" ] + 1L
115+ result <- test_results [[tt ]][[aa ]]
116+ ex <- result $ error
117117 msg <- c(sprintf(" Error of class %s with message:" , sQuote(class(ex )[1 ])),
118118 conditionMessage(ex ))
119119 call <- conditionCall(ex )
120- if (length(call ) > 0 ) msg <- c(msg , " Call:" , deparse(call ))
121- if (length(result $ output ) > 0 ) msg <- c(msg , " Output:" , result $ output )
122- } else if (status [aa ] == " SKIP" ) {
120+ if (length(call ) > 0 ) msg <- c(msg , " Call:" , deparse(call ))
121+ code <- paste(deparse(test $ expr ), collapse = " \n " )
122+ msg <- c(msg , " Test code:" , code )
123+ if (length(result $ output ) > 0 ) msg <- c(msg , " Output:" , result $ output )
124+ } else if (status [aa ] == " SKIP" ) {
123125 cat(sprintf(" %s %s\n " , skip , args_tag ))
124- total [" SKIP" ] <- total [" SKIP" ] + 1L
126+ total [" SKIP" ] <- total [" SKIP" ] + 1L
125127 msg <- conditionMessage(test_results [[tt ]][[aa ]]$ skipped )
126- } else if (status [aa ] == " TIMEOUT" ) {
128+ } else if (status [aa ] == " TIMEOUT" ) {
127129 cat(sprintf(" %s %s %s\n " , timeout_error , args_tag , yellow(sprintf(" (> %s)" , pretty_sec(timeout )))))
128- total [" TIMEOUT" ] <- total [" TIMEOUT" ] + 1L
130+ total [" TIMEOUT" ] <- total [" TIMEOUT" ] + 1L
129131 }
130132
131133 if (is.character(msg ) && length(msg ) > 0L && any(nzchar(msg ) > 0L )) {
0 commit comments