R Under development (unstable) (2024-05-22 r86590 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > source("helper/helper.R") > > wb = function(...) backports:::...names() > > if (exists("...names", envir = baseenv()) && getRversion() > "4.1.2") { + f = get("...names", envir = baseenv()) + wf = function(...) f() + expect_same = makeCompareFun(wf, wb) + + expect_same(1, 2) + expect_same(a = 1) + expect_same(1, b = 2) + expect_same() + + expect_identical(wb(a = 1, 2), c("a", "")) + } > > expect_identical(wb(a = 1, b = 2), c("a", "b")) > > > # issue 64 > bp_...names = getFromNamespace("...names", "backports") > > test1 <- function(...) { + ...names() + } > > test2 <- function(...) { + bp_...names() + } > > expect_identical( + test1("ABC"), + test2("ABC") + ) > > expect_identical( + test1(a = "b", ), + test2(a = "b", ) + ) > > proc.time() user system elapsed 0.20 0.10 0.29