tests/testthat/test-cdmSelect.R

test_that("cdmSelect", {
  cdm <- emptyCdmReference("test db")
  expect_true(all(c("person", "observation_period") %in% names(cdm)))
  cdm1 <- cdm |> cdmSelect("person")
  expect_true("person" %in% names(cdm1))
  expect_false("observation_period" %in% names(cdm1))
  cdm2 <- cdm |> cdmSelect(!"person")
  expect_false("person" %in% names(cdm2))
  expect_true("observation_period" %in% names(cdm2))
})

Try the omopgenerics package in your browser

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

omopgenerics documentation built on Sept. 30, 2024, 9:16 a.m.