tests/testthat/test-gl_rule.R

test_that(".gl_rule integrates polynomials of degree 2n - 1 exactly", {
  r <- .gl_rule(6L)
  expect_equal(sum(r$w), 2, tolerance = 1e-14)
  expect_equal(sum(r$w * r$x^10), 2 / 11, tolerance = 1e-13)
  expect_equal(sum(r$w * r$x^11), 0, tolerance = 1e-13)
  expect_true(all(diff(r$x) > 0))
})

Try the DesignComplexSurvival package in your browser

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

DesignComplexSurvival documentation built on Nov. 23, 2026, 5:07 p.m.