Skip to content

Commit

Permalink
SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Dec 17, 2023
1 parent 1b6b9f7 commit 9b4e610
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions R/spec-result-roundtrip.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ spec_result_roundtrip <- list(

data_date_current = function(ctx, con) {
#' (also applies to the return value of the SQL function `current_date`)
# FIXME: Turn into two checks, each with a separate skip
# depending on the tweak, to avoid mangling the query at run time
# Same with current_time and current_timestamp
test_select_with_null(
.ctx = ctx, con,
"current_date" ~ is_roughly_current_date
Expand Down Expand Up @@ -273,6 +276,7 @@ test_select <- function(
# Run time
.ctx,
.envir = parent.frame()) {

values <- list2(...)

value_is_formula <- map_lgl(values, is.call)
Expand All @@ -290,12 +294,16 @@ test_select <- function(
sql_values <- names(values)
}

if (isTRUE(.ctx$tweaks$current_needs_parens)) {
sql_values <- gsub(
"^(current_(?:date|time|timestamp))$", "\\1()",
sql_values
)
}
sql_values_expr <- expr({
sql_values <- !!construct_expr(sql_values)

if (isTRUE(.ctx$tweaks$current_needs_parens)) {
sql_values <- gsub(
"^(current_(?:date|time|timestamp))$", "\\1()",
sql_values
)
}
})

sql_names <- letters[seq_along(sql_values)]

Expand Down

0 comments on commit 9b4e610

Please sign in to comment.