diff --git a/R/spec-meta-bind.R b/R/spec-meta-bind.R index e32ec1373..1cfe2a346 100644 --- a/R/spec-meta-bind.R +++ b/R/spec-meta-bind.R @@ -546,7 +546,7 @@ spec_meta_bind <- list( res <- NULL } }, - bind_character_escape = function(ctx, con) { + bind_character_escape = if (getRversion() >= "4.0") function(ctx, con) { placeholder_funs <- get_placeholder_funs(ctx) is_null_check <- ctx$tweaks$is_null_check for (placeholder_fun in placeholder_funs) { diff --git a/tests/testthat/helper-dev.R b/tests/testthat/helper-dev.R index 1008446ae..6ff09908e 100644 --- a/tests/testthat/helper-dev.R +++ b/tests/testthat/helper-dev.R @@ -59,6 +59,12 @@ inline_meta_tests <- function() { text <- trimws(format(cs$code), "right") text[[1]] <- paste0("spec_meta_bind <- ", text[[1]]) + # Hack + text <- gsub( + "bind_character_escape = ", + 'bind_character_escape = if (getRversion() >= "4.0") ', + text + ) text <- c( "# Generated by helper-dev.R, do not edit by hand", "",