Skip to content

Commit

Permalink
bind_values_expr constructive
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Dec 17, 2023
1 parent 7673e43 commit 0d818d0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Depends:
Imports:
blob (>= 1.2.0),
callr,
constructive,
DBI (>= 1.1.3.9004),
desc,
hms (>= 0.5.0),
Expand Down
7 changes: 6 additions & 1 deletion R/spec-meta-bind-runner.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ run_bind_tester$fun <- function(
force(is_untouched)

bind_values_expr <- rlang::expr({
bind_values <- !!bind_values
bind_values <- !!construct_expr(bind_values)
})

skip_expr <- if (!is.null(skip_fun) && skip_fun()) rlang::expr({
Expand Down Expand Up @@ -222,3 +222,8 @@ run_bind_tester$fun <- function(
rm(bind_values)
rlang::eval_bare(test_expr)
}

construct_expr <- function(x) {
xc <- constructive::construct(x)
rlang::parse_expr(format(xc$code))
}
8 changes: 6 additions & 2 deletions R/spec-meta-bind.R
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,13 @@ spec_meta_bind <- list(
test_select_bind(con, ctx, c(get_texts(), NA))
},

bind_character_escape = function(ctx, con) {
bind_character_escape = if (getRversion() >= "4.0") function(ctx, con) {
#' (also with special characters such as spaces, newlines, quotes, and backslashes)
test_select_bind(con, ctx, c(" ", "\n", "\r", "\b", "'", '"', "[", "]", "\\", NA))
test_select_bind(
con,
ctx,
c(" ", "\n", "\r", "\b", "'", '"', "[", "]", "\\", NA)
)
},

bind_factor = function(ctx, con) {
Expand Down

0 comments on commit 0d818d0

Please sign in to comment.