Debian Codegraph @

tests/testthat/test-muhaz.R

raw
1 skip_on_cran()
2
3 skip_if_not_installed("modeltests")
4 library(modeltests)
5
6 skip_if_not_installed("muhaz")
7 skip_if_not_installed("survival") # does this skip with base R?
8
9 suppressPackageStartupMessages(library(muhaz))
10
11 # load the ovarian data
12 data(cancer, package = "survival")
13
14 fit <- muhaz(ovarian$futime, ovarian$fustat)
15
16 test_that("muhaz tidier arguments", {
17 check_arguments(tidy.muhaz)
18 check_arguments(glance.muhaz)
19 })
20
21 test_that("tidy.muhaz", {
22 td <- tidy(fit)
23 check_tidy_output(td)
24 check_dims(td, expected_cols = 2)
25 })
26
27 test_that("glance.muhaz", {
28 gl <- glance(fit)
29 check_glance_outputs(gl, strict = FALSE)
30 check_dims(gl, expected_cols = 5)
31 })