Skip to content

Commit

Permalink
Update test-Surv_CNSR.R (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg authored Jun 15, 2022
1 parent d6a3c6c commit 07b9ad0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/testthat/test-Surv_CNSR.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#' T2.3 A warning when the column specified through AVAL has negative values
#' T2.4 An error when the column name specified through CNSR is not present in the environment
#' T2.5 An error when the column name specified through CNSR in the environment is not numeric
#' T2.6 An error when the column name specified through CNSR is not coded as 0/1

# Requirement T1 ----------------------------------------------------------

Expand Down Expand Up @@ -101,4 +102,8 @@ testthat::test_that("T2.5 An error when the column name specified through CNSR i
testthat::expect_error(survival::survfit(visR::Surv_CDISC(AVAL = time) ~ 1, data = survival::lung %>% dplyr::mutate(CNSR = as.character(status))))
})

testthat::test_that("T2.6 An error when the column name specified through CNSR is not coded as 0/1", {
testthat::expect_error(survival::survfit(visR::Surv_CNSR(time, status) ~ 1, data = survival::lung))
})

# END OF CODE -------------------------------------------------------------

0 comments on commit 07b9ad0

Please sign in to comment.