tests/testthat/test-ggsurvplot_basic.R

test_that("basic KM plot runs without {lifecycle} warnings", {
  rlang::local_options(lifecycle_verbosity = "warning")

  expect_no_warning(
    {
      ggsurvplot(
        fit = survfit(Surv(time = time, event = status) ~ x, data = aml),
        surv.median.line = "hv"
      )
    },
    class = "lifecycle_warning_deprecated"
  )
})

test_that("basic KM plot runs without {lifecycle} errors", {
  expect_no_error(
    {
      ggsurvplot(
        fit = survfit(Surv(time = time, event = status) ~ x, data = aml),
        surv.median.line = "hv"
      )
    },
    class = "lifecycle_error_deprecated"
  )
})

Try the survminer package in your browser

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

survminer documentation built on Feb. 25, 2026, 9:06 a.m.