From f921d0b9b8b136175682cc24342dc7f3f3db5c3a Mon Sep 17 00:00:00 2001 From: Nicolas Bennett <3158446+nbenn@users.noreply.github.com> Date: Sat, 25 Nov 2023 12:06:26 +0100 Subject: [PATCH] preserve integer64 class --- R/spec-result-roundtrip.R | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/R/spec-result-roundtrip.R b/R/spec-result-roundtrip.R index 575fb4c72..1594ea35e 100644 --- a/R/spec-result-roundtrip.R +++ b/R/spec-result-roundtrip.R @@ -264,9 +264,16 @@ test_select_with_null <- function(...) { test_select(..., .add_null = "below") } +as_list_with_preserve_class <- function(x) { + lapply(x, `class<-`, attr(x, "class")) +} + test_select <- function(con, ..., .dots = NULL, .add_null = "none", .ctx, .envir = parent.frame()) { - values <- c(list(...), .dots) + values <- c( + as_list_with_preserve_class(list(...)), + as_list_with_preserve_class(.dots) + ) value_is_formula <- vapply(values, is.call, logical(1L)) names(values)[value_is_formula] <- lapply(values[value_is_formula], "[[", 2L)