1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-24 18:06:11 +01:00

unit tests

This commit is contained in:
dr. M.S. (Matthijs) Berends 2018-09-17 21:51:21 +02:00
parent 5d80cef338
commit df5d82fff3
4 changed files with 9 additions and 0 deletions

View File

@ -42,5 +42,6 @@ test_that("counts work", {
expect_error(count_S("test", as_percent = "test"))
expect_error(count_df(c("A", "B", "C")))
expect_error(count_df(septic_patients[,"date"]))
})

View File

@ -38,4 +38,10 @@ test_that("ggplot_rsi works", {
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"))
})

View File

@ -12,6 +12,7 @@ test_that("mo_property works", {
expect_equal(mo_type("E. coli", language = "en"), "Bacteria")
expect_equal(mo_gramstain("E. coli", language = "en"), "Negative rods")
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", Becker = TRUE), "S. aureus")

View File

@ -167,4 +167,5 @@ test_that("prediction of rsi works", {
info = TRUE))
expect_error(portion_df(c("A", "B", "C")))
expect_error(portion_df(septic_patients[,"date"]))
})