@@ -79,7 +79,7 @@ expect_known_output <- function(
7979
8080compare_file <- function (path , lines , ... , update = TRUE , info = NULL ) {
8181 if (! file.exists(path )) {
82- warning (" Creating reference output" , call. = FALSE )
82+ cli :: cli_warn (" Creating reference output. " )
8383 brio :: write_lines(lines , path )
8484 return (pass(NULL ))
8585 }
@@ -88,11 +88,11 @@ compare_file <- function(path, lines, ..., update = TRUE, info = NULL) {
8888 if (update ) {
8989 brio :: write_lines(lines , path )
9090 if (! all_utf8(lines )) {
91- warning (" New reference output is not UTF-8 encoded" , call. = FALSE )
91+ cli :: cli_warn (" New reference output is not UTF-8 encoded. " )
9292 }
9393 }
9494 if (! all_utf8(old_lines )) {
95- warning (" Reference output is not UTF-8 encoded" , call. = FALSE )
95+ cli :: cli_warn (" Reference output is not UTF-8 encoded. " )
9696 }
9797
9898 comp <- waldo_compare(
@@ -178,7 +178,7 @@ expect_known_value <- function(
178178 act <- quasi_label(enquo(object ), label )
179179
180180 if (! file.exists(file )) {
181- warning (" Creating reference value" , call. = FALSE )
181+ cli :: cli_warn (" Creating reference value. " )
182182 saveRDS(object , file , version = version )
183183 } else {
184184 ref_val <- readRDS(file )
@@ -232,7 +232,7 @@ expect_known_hash <- function(object, hash = NULL) {
232232 }
233233
234234 if (is.null(hash )) {
235- warning(paste0( " No recorded hash: use " , substr(act_hash , 1 , 10 )) )
235+ cli :: cli_warn( " No recorded hash: use { substr(act_hash, 1, 10)}. " )
236236 } else {
237237 if (hash != act_hash ) {
238238 msg <- sprintf(" Value hashes to %s, not %s" , act_hash , hash )
0 commit comments