mirror of
https://github.com/msberends/AMR.git
synced 2025-08-17 22:13:16 +02:00
fixes
This commit is contained in:
@@ -27,7 +27,7 @@ MOs <- subset(microorganisms, !is.na(mo) & nchar(mo) > 3)
|
||||
expect_identical(as.character(MOs$mo), as.character(as.mo(MOs$mo)))
|
||||
|
||||
expect_identical(
|
||||
as.character(as.mo(c("E. coli", "H. influenzae"))),
|
||||
as.character(as.mo(c("E. coli", "H. influenzae"), keep_synonyms = FALSE)),
|
||||
c("B_ESCHR_COLI", "B_HMPHL_INFL")
|
||||
)
|
||||
|
||||
@@ -41,7 +41,7 @@ expect_equal(as.character(as.mo(" B_ESCHR_COLI ")), "B_ESCHR_COLI")
|
||||
expect_equal(as.character(as.mo("e coli")), "B_ESCHR_COLI") # not Campylobacter
|
||||
expect_equal(as.character(as.mo("klpn")), "B_KLBSL_PNMN")
|
||||
expect_equal(as.character(as.mo("Klebsiella")), "B_KLBSL")
|
||||
expect_equal(as.character(as.mo("K. pneu rhino")), "B_KLBSL_PNMN_RHNS") # K. pneumoniae subspp. rhinoscleromatis
|
||||
expect_equal(as.character(as.mo("K. pneumo rhino")), "B_KLBSL_PNMN_RHNS") # K. pneumoniae subspp. rhinoscleromatis
|
||||
expect_equal(as.character(as.mo("Bartonella")), "B_BRTNL")
|
||||
expect_equal(as.character(as.mo("C. difficile")), "B_CRDDS_DFFC")
|
||||
expect_equal(as.character(as.mo("L. pneumophila")), "B_LGNLL_PNMP")
|
||||
@@ -284,12 +284,12 @@ expect_stdout(print(mo_uncertainties()))
|
||||
|
||||
# Salmonella (City) are all actually Salmonella enterica spp (City)
|
||||
expect_equal(
|
||||
suppressMessages(as.mo(c("Salmonella Goettingen", "Salmonella Typhimurium", "Salmonella Group A"))),
|
||||
suppressMessages(as.mo(c("Salmonella Goettingen", "Salmonella Typhimurium", "Salmonella Group A"), keep_synonyms = FALSE)),
|
||||
as.mo(c("Salmonella enterica", "Salmonella enterica", "Salmonella"))
|
||||
)
|
||||
|
||||
# no viruses
|
||||
expect_equal(as.character(as.mo("Virus")), NA_character_)
|
||||
expect_equal(as.mo("Virus"), as.mo("UNKNOWN"))
|
||||
|
||||
# summary
|
||||
expect_equal(length(summary(example_isolates$mo)), 6)
|
||||
|
@@ -75,13 +75,10 @@ expect_identical(MOs$fullname, mo_fullname(MOs$fullname, language = "en"))
|
||||
expect_equal(mo_type("Escherichia coli", language = "de"), "Bakterien")
|
||||
expect_equal(mo_gramstain("Escherichia coli", language = "nl"), "Gram-negatief")
|
||||
|
||||
expect_stdout(print(mo_gramstain("Escherichia coli", language = "en")))
|
||||
expect_stdout(print(mo_gramstain("Escherichia coli", language = "de")))
|
||||
expect_stdout(print(mo_gramstain("Escherichia coli", language = "nl")))
|
||||
expect_stdout(print(mo_gramstain("Escherichia coli", language = "es")))
|
||||
expect_stdout(print(mo_gramstain("Escherichia coli", language = "pt")))
|
||||
expect_stdout(print(mo_gramstain("Escherichia coli", language = "it")))
|
||||
expect_stdout(print(mo_gramstain("Escherichia coli", language = "fr")))
|
||||
for (l in LANGUAGES_SUPPORTED) {
|
||||
expect_stdout(print(mo_gramstain("Escherichia coli", language = l)))
|
||||
print(mo_gramstain("Escherichia coli", language = l))
|
||||
}
|
||||
|
||||
expect_error(mo_gramstain("Escherichia coli", language = "UNKNOWN"))
|
||||
dutch <- mo_name(microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase")], language = "nl") # should be transformable to English again
|
||||
|
Reference in New Issue
Block a user