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))
})

Try the BrokenAdaptiveRidge package in your browser

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

BrokenAdaptiveRidge documentation built on Aug. 8, 2025, 7:36 p.m.