Skip to content

Commit

Permalink
Fix checks for R < 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Dec 17, 2023
1 parent 6d35631 commit 3e53a2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/spec-meta-bind.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/helper-dev.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"",
Expand Down

0 comments on commit 3e53a2a

Please sign in to comment.