tests/testthat/test-12_FilterArgs4Func.R

test_that("multiplication works", {
  f <- function(
    a = 1L,
    b = 2L,
    c = 3L,
    ...
  ) {
    a * b * c
    message(a, b, c, ...)
  }

  l <- list(a = 10L, b = 20L, x = 30L, y = 40L)

  l2 <- FilterArgs4Func(l, f)
  expect_equal(l2, list(a = 10L, b = 20L))
})

Try the SigBridgeRUtils package in your browser

Any scripts or data that you put into this service are public.

SigBridgeRUtils documentation built on Sept. 29, 2026, 5:09 p.m.