1
0
mirror of https://github.com/msberends/AMR.git synced 2025-05-01 12:53:49 +02:00

(v2.1.1.9257) adjust unit tests

This commit is contained in:
dr. M.S. (Matthijs) Berends 2025-04-27 09:58:19 +02:00
parent f340e257fa
commit d2b3937a90
No known key found for this signature in database
4 changed files with 10 additions and 13 deletions

View File

@ -1,6 +1,6 @@
Package: AMR Package: AMR
Version: 2.1.1.9256 Version: 2.1.1.9257
Date: 2025-04-26 Date: 2025-04-27
Title: Antimicrobial Resistance Data Analysis Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR) Description: Functions to simplify and standardise antimicrobial resistance (AMR)
data analysis and to work with microbial and antimicrobial properties by data analysis and to work with microbial and antimicrobial properties by

View File

@ -1,4 +1,4 @@
# AMR 2.1.1.9256 # AMR 2.1.1.9257
*(this beta version will eventually become v3.0. We're happy to reach a new major milestone soon, which will be all about the new One Health support! Install this beta using [the instructions here](https://amr-for-r.org/#get-this-package).)* *(this beta version will eventually become v3.0. We're happy to reach a new major milestone soon, which will be all about the new One Health support! Install this beta using [the instructions here](https://amr-for-r.org/#get-this-package).)*

View File

@ -53,7 +53,7 @@ test_that("test-antibiogram.R", {
expect_inherits(ab2, "antibiogram") expect_inherits(ab2, "antibiogram")
expect_inherits(ab3, "antibiogram") expect_inherits(ab3, "antibiogram")
expect_equal(colnames(ab1), c("Pathogen", "Amikacin", "Gentamicin", "Imipenem", "Kanamycin", "Meropenem", "Tobramycin")) expect_equal(colnames(ab1), c("Pathogen", "Amikacin", "Gentamicin", "Imipenem", "Kanamycin", "Meropenem", "Tobramycin"))
expect_equal(colnames(ab2), c("Pathogen (N min-max)", "J01GB01", "J01GB03", "J01GB04", "J01GB06")) expect_equal(colnames(ab2), c("Pathogen", "J01GB01", "J01GB03", "J01GB04", "J01GB06"))
expect_equal(colnames(ab3), c("Pathogen", "IPM", "MEM")) expect_equal(colnames(ab3), c("Pathogen", "IPM", "MEM"))
expect_equal(ab3$MEM, c(52, NA, 100, 100, NA)) expect_equal(ab3$MEM, c(52, NA, 100, 100, NA))
@ -96,14 +96,13 @@ test_that("test-antibiogram.R", {
syndromic_group = ifelse(ex1$ward == "ICU", syndromic_group = ifelse(ex1$ward == "ICU",
"IC", "Geen IC" "IC", "Geen IC"
), ),
language = "nl", language = "nl"
add_total_n = TRUE
) )
expect_inherits(ab6, "antibiogram") expect_inherits(ab6, "antibiogram")
expect_inherits(ab7, "antibiogram") expect_inherits(ab7, "antibiogram")
expect_equal(colnames(ab6), c("Syndromic Group", "Pathogen", "AMK", "GEN", "IPM", "KAN", "MEM", "TOB")) expect_equal(colnames(ab6), c("Syndromic Group", "Pathogen", "AMK", "GEN", "IPM", "KAN", "MEM", "TOB"))
expect_equal(colnames(ab7), c("Syndroomgroep", "Pathogeen (N min-max)", "Amikacine", "Gentamicine", "Tobramycine")) expect_equal(colnames(ab7), c("Syndroomgroep", "Pathogeen", "Amikacine", "Gentamicine", "Tobramycine"))
# Weighted-incidence syndromic combination antibiogram (WISCA) --------- # Weighted-incidence syndromic combination antibiogram (WISCA) ---------

View File

@ -325,15 +325,13 @@ test_that("test-sir.R", {
expect_message(as.sir(data.frame( expect_message(as.sir(data.frame(
mo = "E. coli", mo = "E. coli",
NIT = c("<= 2", 32), NIT = c("<= 2", 32),
uti = TRUE, uti = TRUE
info = TRUE ), info = TRUE))
)))
expect_message(as.sir(data.frame( expect_message(as.sir(data.frame(
mo = "E. coli", mo = "E. coli",
NIT = c("<= 2", 32), NIT = c("<= 2", 32),
specimen = c("urine", "blood"), specimen = c("urine", "blood")
info = TRUE ), info = TRUE))
)))
# SDD vs I in CLSI 2024 # SDD vs I in CLSI 2024
expect_identical( expect_identical(