tests/testthat/test_survglg.R

context("Length of the list that is returned by the survglg() function.")

test_that("test if survglg() returns a list of length 31", {
    expect_length(survglg(Surv(log(obst1), delta1) ~ x1 + x2 - 1, data = example_sglg,
        shape = 1), 31)
})

context("Messages are returned by the survglg() function.")

test_that("test if survglg() returns warning messages.", {
    expect_error(survglg(data = example_sglg), "The formula argument is missing.")
    expect_error(survglg(Surv(log(obst1), delta1) ~ x1 + x2 - 1), "The data argument is missing.")
})

Try the sglg package in your browser

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

sglg documentation built on Sept. 4, 2022, 9:05 a.m.