(v2.1.1.9127) unit tests

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2025-01-27 10:46:43 +01:00
1 parent 66833b4f5a
commit 7accf6ff13
19 files changed
+217 -226

No files matched your search

+2 -1
View File
@@ -27,4 +27,5 @@
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
# ==================================================================== #
expect_warning(example_isolates[, ab_class("mycobact")])
expect_warning(example_isolates[, ab_selector(name %like% "trim")])
+2 -1
View File
@@ -28,7 +28,8 @@
# ==================================================================== #
# antibiotic class selectors
expect_equal(ncol(example_isolates[, ab_class("antimyco"), drop = FALSE]), 1, tolerance = 0.5)
expect_equal(ncol(example_isolates[, amr_class("antimyco"), drop = FALSE]), 1, tolerance = 0.5)
expect_equal(ncol(example_isolates[, amr_selector(name %like% "trim"), drop = FALSE]), 2, tolerance = 0.5)
expect_equal(ncol(example_isolates[, aminoglycosides(), drop = FALSE]), 4, tolerance = 0.5)
expect_equal(ncol(example_isolates[, aminopenicillins(), drop = FALSE]), 2, tolerance = 0.5)
expect_equal(ncol(example_isolates[, betalactams(), drop = FALSE]), 16, tolerance = 0.5)
+2 -6
View File
@@ -128,9 +128,7 @@ expect_silent(plot(ab5))
expect_silent(plot(ab6))
expect_silent(plot(ab7))
expect_silent(plot(ab8))
if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) {
expect_silent(plot(ab9))
}
expect_error(plot(ab9))
if (AMR:::pkg_is_available("ggplot2")) {
expect_inherits(ggplot2::autoplot(ab1), "gg")
@@ -141,7 +139,5 @@ if (AMR:::pkg_is_available("ggplot2")) {
expect_inherits(ggplot2::autoplot(ab6), "gg")
expect_inherits(ggplot2::autoplot(ab7), "gg")
expect_inherits(ggplot2::autoplot(ab8), "gg")
if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) {
expect_inherits(ggplot2::autoplot(ab9), "gg")
}
expect_error(ggplot2::autoplot(ab9))
}