tests/testthat/test-independent-testing-meta_check.R

test_that("variable 'RACE' checking", {
  p <- meta_check_var(meta_example(), var = "RACE", type = c("observation"))
  expect_true("RACE" %in% names(p$data_observation))
})



test_that("variable 'AEDECOD' checking in population", {
  expect_error(meta_check_var(meta_example(), var = "AEDECOD", type = c("population")))
})

test_that("variable 'AEDECOD' checking in observation", {
  q <- meta_check_var(meta_example(), var = "AEDECOD", type = c("observation"))
  expect_true("AEDECOD" %in% names(q$data_observation))
})



test_that("variable 'BMIBL' checking in population or observation", {
  expect_error(meta_check_var(meta_example(), var = "BMIBL", type = c("population", "observation")))
})


test_that("variable 'BMIBL' checking in population", {
  l <- meta_check_var(meta_example(), var = "BMIBL", type = c("population"))
  expect_true("BMIBL" %in% names(l$data_population))
})

test_that("variable 'BMIBL' checking in obervation", {
  expect_error(meta_check_var(meta_example(), var = "BMIBL", type = c("observation")))
})

Try the metalite package in your browser

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

metalite documentation built on Sept. 11, 2024, 7:18 p.m.