mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 06:02:01 +02:00
support for French and Italian, added quote to freq
This commit is contained in:
@ -16,13 +16,6 @@ test_that("mo_property works", {
|
||||
expect_equal(mo_shortname("S. aga"), "S. agalactiae")
|
||||
expect_equal(mo_shortname("S. aga", Lancefield = TRUE), "GBS")
|
||||
|
||||
expect_equal(mo_type("E. coli", language = "de"), "Bakterium")
|
||||
|
||||
expect_equal(mo_type("E. coli", language = "nl"), "Bacterie")
|
||||
expect_equal(mo_gramstain("E. coli", language = "nl"), "Negatieve staven")
|
||||
|
||||
expect_error(mo_type("E. coli", language = "INVALID"))
|
||||
|
||||
# test integrity
|
||||
library(dplyr)
|
||||
MOs <- AMR::microorganisms %>% filter(!is.na(mo))
|
||||
@ -45,4 +38,19 @@ test_that("mo_property works", {
|
||||
expect_gt(sum(tb$c) / nrow(tb), 0.9) # more than 90% of MO code should be identical
|
||||
expect_identical(sum(tb$f), nrow(tb)) # all shortnames should be identical
|
||||
|
||||
# check languages
|
||||
expect_equal(mo_type("E. coli", language = "de"), "Bakterium")
|
||||
expect_equal(mo_type("E. coli", language = "nl"), "Bacterie")
|
||||
expect_equal(mo_gramstain("E. coli", language = "nl"), "Negatieve staven")
|
||||
|
||||
expect_output(print(mo_gramstain("E. coli", language = "en")))
|
||||
expect_output(print(mo_gramstain("E. coli", language = "de")))
|
||||
expect_output(print(mo_gramstain("E. coli", language = "nl")))
|
||||
expect_output(print(mo_gramstain("E. coli", language = "es")))
|
||||
expect_output(print(mo_gramstain("E. coli", language = "pt")))
|
||||
expect_output(print(mo_gramstain("E. coli", language = "it")))
|
||||
expect_output(print(mo_gramstain("E. coli", language = "fr")))
|
||||
|
||||
expect_error(mo_gramstain("E. coli", language = "UNKNOWN"))
|
||||
|
||||
})
|
||||
|
Reference in New Issue
Block a user