From ad3061c754d19e9b97e574538e4edfa8a3b014fb Mon Sep 17 00:00:00 2001 From: Matthijs Berends Date: Sat, 15 Apr 2023 10:32:37 +0200 Subject: [PATCH] unit test --- DESCRIPTION | 2 +- NEWS.md | 2 +- inst/tinytest/test-mo.R | 9 ++------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9d0ddb53..623c24dc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 2.0.0.9007 +Version: 2.0.0.9008 Date: 2023-04-15 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index 9fa91d4e..b6e00503 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 2.0.0.9007 +# AMR 2.0.0.9008 ## Changed * formatting fix for `sir_interpretation_history()` diff --git a/inst/tinytest/test-mo.R b/inst/tinytest/test-mo.R index 04a55ae1..9878ccdf 100644 --- a/inst/tinytest/test-mo.R +++ b/inst/tinytest/test-mo.R @@ -279,13 +279,8 @@ expect_equal(suppressWarnings(as.mo("Virus")), as.mo("UNKNOWN")) expect_equal(length(summary(example_isolates$mo)), 6) # WHONET codes and NA/NaN -expect_equal( - as.character(as.mo(c("xxx", "na", "nan"))), - rep(NA_character_, 3) -) -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_true(all(is.na(as.mo(c("xxx", "na", "nan"))))) +expect_equal(as.character(as.mo(c("con", "eco"))), c("UNKNOWN", "B_ESCHR_COLI")) expect_equal( as.character(suppressWarnings(as.mo(c("other", "none", "unknown")))), rep("UNKNOWN", 3)