mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 15:01:51 +02:00
(v.1.5.0.9000) implementation of EUCAST rules v11 (2021)
This commit is contained in:
@ -23,10 +23,10 @@
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
# the testthat package is in Suggests, but very old R versions will not be
|
||||
# able to install it. Yet, we want checks in those R versions as well, so
|
||||
# only run unit tests in later R versions:
|
||||
if (require("testthat")) {
|
||||
# the testthat package is in Suggests, but very old R versions will not be
|
||||
# able to install it. Yet, we want checks in those R versions as well, so
|
||||
# only run unit tests in later R versions:
|
||||
library(testthat, warn.conflicts = FALSE)
|
||||
library(AMR)
|
||||
test_check("AMR")
|
||||
|
@ -40,14 +40,17 @@ test_that("data sets are valid", {
|
||||
expect_true(all(example_isolates$mo %in% microorganisms$mo))
|
||||
expect_true(all(microorganisms.translation$mo_new %in% microorganisms$mo))
|
||||
expect_true(all(rsi_translation$mo %in% microorganisms$mo))
|
||||
expect_true(all(rsi_translation$ab %in% antibiotics$ab))
|
||||
expect_true(all(intrinsic_resistant$microorganism %in% microorganisms$fullname)) # also important for mo_is_intrinsic_resistant()
|
||||
expect_true(all(intrinsic_resistant$antibiotic %in% antibiotics$name))
|
||||
expect_false(any(is.na(microorganisms.codes$code)))
|
||||
expect_false(any(is.na(microorganisms.codes$mo)))
|
||||
expect_false(any(microorganisms.translation$mo_old %in% microorganisms$mo))
|
||||
expect_true(all(dosage$ab %in% antibiotics$ab))
|
||||
expect_true(all(dosage$name %in% antibiotics$name))
|
||||
|
||||
# antibiotic names must always be coercible to their original AB code
|
||||
expect_identical(antibiotics$ab, as.ab(antibiotics$name))
|
||||
expect_identical(as.ab(antibiotics$name), antibiotics$ab)
|
||||
|
||||
# there should be no diacritics (i.e. non ASCII) characters in the datasets (CRAN policy)
|
||||
datasets <- data(package = "AMR", envir = asNamespace("AMR"))$results[, "Item"]
|
||||
|
Reference in New Issue
Block a user