(v1.2.0.9036) unit test fix

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2020-07-22 12:29:51 +02:00
1 parent 09fba38ea6
commit ab2b359e6b
13 files changed
+29 -25

No files matched your search

+1 -1
View File
@@ -97,7 +97,7 @@ test_that("mo_property works", {
expect_equal(mo_snomed("Escherichia coli"), 112283007)
# old codes must throw a warning in mo_* family
expect_warning(mo_name(c("B_ESCHR_COL", "B_STPHY_AUR")))
expect_message(mo_name(c("B_ESCHR_COL", "B_STPHY_AUR")))
# outcome of mo_fullname must always return the fullname from the data set
x <- data.frame(mo = microorganisms$mo,
+9 -8
View File
@@ -37,16 +37,17 @@ test_that("rsi works", {
expect_equal(as.character(as.rsi(c(1:3))), c("S", "I", "R"))
expect_equal(suppressWarnings(as.logical(as.rsi("INVALID VALUE"))), NA)
expect_equal(summary(as.rsi(c("S", "R"))), c("Class" = "rsi",
"%R" = "50% (n=1)",
"%SI" = "50% (n=1)",
"- %S" = "50% (n=1)",
"- %I" = "0% (n=0)"))
expect_equal(summary(as.rsi(c("S", "R"))),
structure(c("Class" = "rsi",
"%R" = "50% (n=1)",
"%SI" = "50% (n=1)",
"- %S" = "50% (n=1)",
"- %I" = "0% (n=0)"), class = c("summaryDefault", "table")))
expect_identical(as.logical(lapply(example_isolates, is.rsi.eligible)),
rep(FALSE, length(example_isolates)))
library(dplyr)
# 40 rsi columns
expect_equal(example_isolates %>%