tests/testthat/test-breakpoints.R

test_that("assert_breakpoints", {
  expect_error(assert_breakpoints(c(large = 1)), "invalid breakpoint name `large`")
  expect_error(assert_breakpoints(c(ww = 1, oo = 2), "invalid breakpoint names `ww` and `oo`"))
})

test_that("prepend_breakpoints", {
  expect_null(prepend_breakpoints(c()))
  expect_equal(1:4, prepend_breakpoints(1:4))
  expect_equal(c(sm = TRUE), prepend_breakpoints(c(sm = TRUE)))
})

Try the cascadess package in your browser

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

cascadess documentation built on Oct. 30, 2024, 9:29 a.m.