mirror of
https://github.com/msberends/AMR.git
synced 2025-07-18 01:23:16 +02:00
(v2.1.1.9127) unit tests
This commit is contained in:
@ -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")])
|
||||
|
@ -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)
|
||||
|
@ -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))
|
||||
}
|
||||
|
Reference in New Issue
Block a user