tests/testthat/test-FastPenalty.R

library("testthat")

test_that("Numeric penalty", {
  prior <- createFastBarPrior(penalty = 10)
  expect_equal(BrokenAdaptiveRidge:::getPenalty(NULL, prior), 10)
})

test_that("Unhandled penalty", {
  prior <- createFastBarPrior(penalty = "ucla")
  expect_error(BrokenAdaptiveRidge:::getPenalty(NULL, prior))
})
OHDSI/BrokenAdaptiveRidge documentation built on April 20, 2023, 10:37 p.m.