mirror of
https://github.com/msberends/AMR.git
synced 2024-12-25 17:26:12 +01:00
unit tests
This commit is contained in:
parent
5d80cef338
commit
df5d82fff3
@ -42,5 +42,6 @@ test_that("counts work", {
|
|||||||
expect_error(count_S("test", as_percent = "test"))
|
expect_error(count_S("test", as_percent = "test"))
|
||||||
|
|
||||||
expect_error(count_df(c("A", "B", "C")))
|
expect_error(count_df(c("A", "B", "C")))
|
||||||
|
expect_error(count_df(septic_patients[,"date"]))
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -38,4 +38,10 @@ test_that("ggplot_rsi works", {
|
|||||||
summarise_all(count_IR) %>% as.double()
|
summarise_all(count_IR) %>% as.double()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
expect_equal(colnames(getlbls(septic_patients %>% select(amcl, cipr))),
|
||||||
|
c("Interpretation", "Antibiotic", "Value", "lbl"))
|
||||||
|
|
||||||
|
expect_error(ggplot_rsi(septic_patients, fun = "invalid"))
|
||||||
|
expect_error(geom_rsi(septic_patients, fun = "invalid"))
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -12,6 +12,7 @@ test_that("mo_property works", {
|
|||||||
expect_equal(mo_type("E. coli", language = "en"), "Bacteria")
|
expect_equal(mo_type("E. coli", language = "en"), "Bacteria")
|
||||||
expect_equal(mo_gramstain("E. coli", language = "en"), "Negative rods")
|
expect_equal(mo_gramstain("E. coli", language = "en"), "Negative rods")
|
||||||
expect_equal(mo_aerobic("E. coli"), TRUE)
|
expect_equal(mo_aerobic("E. coli"), TRUE)
|
||||||
|
expect_equal(class(mo_taxonomy("E. coli")), "list")
|
||||||
|
|
||||||
expect_equal(mo_shortname("MRSA"), "S. aureus")
|
expect_equal(mo_shortname("MRSA"), "S. aureus")
|
||||||
expect_equal(mo_shortname("MRSA", Becker = TRUE), "S. aureus")
|
expect_equal(mo_shortname("MRSA", Becker = TRUE), "S. aureus")
|
||||||
|
@ -167,4 +167,5 @@ test_that("prediction of rsi works", {
|
|||||||
info = TRUE))
|
info = TRUE))
|
||||||
|
|
||||||
expect_error(portion_df(c("A", "B", "C")))
|
expect_error(portion_df(c("A", "B", "C")))
|
||||||
|
expect_error(portion_df(septic_patients[,"date"]))
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user