Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 24, 2024
1 parent 83be942 commit 5f4b2d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/testthat/test-coxme.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ withr::with_environment(
m1 <- suppressWarnings(coxme::coxme(Surv(time, status) ~ ph.ecog + age + (1 | inst), d))
m2 <- suppressWarnings(coxme::coxme(Surv(time, status) ~ ph.ecog + age + (1 | inst) + (1 | inst2), d))

expect_identical(clean_names(m1), c("time", "status", "ph.ecog", "age", "inst"))
expect_identical(clean_names(m2), c("time", "status", "ph.ecog", "age", "inst", "inst2"))

expect_identical(clean_names(find_terms(m1)$conditional), c("ph.ecog", "age"))
expect_identical(clean_names(find_terms(m1)$random), "inst")

expect_identical(clean_names(find_terms(m2)$conditional), c("ph.ecog", "age"))
expect_identical(clean_names(find_terms(m2)$random), c("inst", "inst2"))

test_that("model_info", {
expect_true(model_info(m1)$is_logit)
expect_false(model_info(m1)$is_linear)
Expand Down

0 comments on commit 5f4b2d2

Please sign in to comment.