mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 13:21:50 +02:00
remove warnings from unit tests
This commit is contained in:
@ -281,6 +281,6 @@ expect_warning(mdro(example_isolates,
|
||||
|
||||
# print groups
|
||||
if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0")) {
|
||||
expect_stdout(x <- mdro(example_isolates %>% group_by(ward), info = TRUE))
|
||||
expect_stdout(x <- mdro(example_isolates %>% group_by(ward), info = TRUE, pct_required_classes = 0))
|
||||
expect_stdout(x <- mdro(example_isolates %>% group_by(ward), guideline = custom, info = TRUE))
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ expect_equal(as.character(as.mo("con")), "UNKNOWN")
|
||||
expect_equal(as.character(as.mo("xxx")), NA_character_)
|
||||
expect_equal(as.character(as.mo(c("xxx", "con", "eco"))), c(NA_character_, "UNKNOWN", "B_ESCHR_COLI"))
|
||||
expect_equal(
|
||||
as.character(as.mo(c("other", "none", "unknown"))),
|
||||
as.character(suppressWarnings(as.mo(c("other", "none", "unknown")))),
|
||||
rep("UNKNOWN", 3)
|
||||
)
|
||||
|
||||
|
@ -84,9 +84,10 @@ for (l in AMR:::LANGUAGES_SUPPORTED[-1]) {
|
||||
expect_false(mo_gramstain("Escherichia coli", language = l) == gr, info = paste("Gram-stain in language", l))
|
||||
}
|
||||
|
||||
# test languages
|
||||
expect_error(mo_gramstain("Escherichia coli", language = "UNKNOWN"))
|
||||
dutch <- mo_name(microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase|Fungi")], language = "nl", keep_synonyms = TRUE) # should be transformable to English again
|
||||
expect_identical(mo_name(dutch, language = NULL, keep_synonyms = TRUE),
|
||||
dutch <- suppressWarnings(mo_name(microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase|Fungi")], language = "nl", keep_synonyms = TRUE)) # should be transformable to English again
|
||||
expect_identical(suppressWarnings(mo_name(dutch, language = NULL, keep_synonyms = TRUE)),
|
||||
microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase|Fungi")]) # gigantic test - will run ALL names
|
||||
|
||||
# manual property function
|
||||
|
Reference in New Issue
Block a user