mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 16:42:10 +02:00
authors from ITIS, diff for freq
This commit is contained in:
@ -141,4 +141,21 @@ test_that("as.mo works", {
|
||||
expect_equal(as.character(suppressWarnings(as.mo(""))),
|
||||
NA_character_)
|
||||
|
||||
# check less prevalent MOs
|
||||
expect_equal(as.character(as.mo("Gomphosphaeria aponina delicatula")), "B_GMPHS_APO_DEL")
|
||||
expect_equal(as.character(as.mo("G apo deli")), "B_GMPHS_APO_DEL")
|
||||
expect_equal(as.character(as.mo("Gomphosphaeria aponina")), "B_GMPHS_APO")
|
||||
expect_equal(as.character(as.mo("Gomphosphaeria species")), "B_GMPHS")
|
||||
expect_equal(as.character(as.mo("Gomphosphaeria")), "B_GMPHS")
|
||||
expect_equal(as.character(as.mo(" B_GMPHS_APO ")), "B_GMPHS_APO")
|
||||
expect_equal(as.character(as.mo("g aponina")), "B_GMPHS_APO")
|
||||
|
||||
# check old names
|
||||
expect_equal(suppressMessages(as.character(as.mo("Escherichia blattae"))), "B_SHMWL_BLA")
|
||||
|
||||
# check uncertain names
|
||||
expect_equal(suppressWarnings(as.character(as.mo("esco extra_text", allow_uncertain = FALSE))), NA_character_)
|
||||
expect_equal(suppressWarnings(as.character(as.mo("esco extra_text", allow_uncertain = TRUE))), "B_ESCHR_COL")
|
||||
expect_warning(as.mo("esco extra_text", allow_uncertain = TRUE))
|
||||
|
||||
})
|
||||
|
@ -15,6 +15,8 @@ test_that("mo_property works", {
|
||||
expect_equal(class(mo_taxonomy("E. coli")), "list")
|
||||
expect_equal(names(mo_taxonomy("E. coli")), c("subkingdom", "phylum", "class", "order",
|
||||
"family", "genus", "species", "subspecies"))
|
||||
expect_equal(mo_authors("E. coli"), "Castellani and Chalmers")
|
||||
expect_equal(mo_year("E. coli"), 1919)
|
||||
|
||||
expect_equal(mo_shortname("MRSA"), "S. aureus")
|
||||
expect_equal(mo_shortname("MRSA", Becker = TRUE), "S. aureus")
|
||||
|
Reference in New Issue
Block a user