File: test-format_survival.R

package info (click to toggle)
r-cran-pillar 1.8.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,840 kB
  • sloc: sh: 13; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 454 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
test_that("survival output", {
  skip_if_not_installed("survival", "3.2.9")

  x <- head(survival::Surv(survival::lung$time, survival::lung$status))
  expect_snapshot({
    pillar(x, width = 20)
    new_tbl(list(x = x))
  })

  skip_if_not(exists("Surv2", asNamespace("survival"), mode = "function"))

  x <- head(survival::Surv2(survival::lung$time, survival::lung$status))
  expect_snapshot({
    pillar(x, width = 20)
    new_tbl(list(x = x))
  })
})