tests/testthat/test-tar_select_names.R

targets::tar_test("tar_select_names()", {
  targets <- list(
    list(
      targets::tar_target(x, 1),
      targets::tar_target(y1, 2)
    ),
    targets::tar_target(y2, 3),
    targets::tar_target(z, 4)
  )
  out <- tar_select_names(targets, starts_with("y"), contains("z"))
  expect_equal(sort(out), sort(c("y1", "y2", "z")))
})

Try the tarchetypes package in your browser

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

tarchetypes documentation built on Oct. 4, 2023, 5:08 p.m.