From 3a5e20c11a8d75b033d4a44260baba1f3324b4ab Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Fri, 23 Sep 2022 16:40:17 +0200 Subject: [PATCH] fixes --- DESCRIPTION | 2 +- NEWS.md | 2 +- R/aa_helper_functions.R | 2 +- inst/tinytest/test-mo_property.R | 11 ++++++----- tests/tinytest.R | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1f530136..f25023b4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 1.8.1.9066 +Version: 1.8.1.9067 Date: 2022-09-23 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index 554b4ea4..878c2b02 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 1.8.1.9066 +# AMR 1.8.1.9067 This version will eventually become v2.0! We're happy to reach a new major milestone soon! diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index d18f2093..e3ea4501 100755 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -1466,7 +1466,7 @@ if (getRversion() < "3.3.0") { } } -if (getRversion() < "3.4.2") { +if (getRversion() < "3.5.0") { isFALSE <- function(x) { is.logical(x) && length(x) == 1L && !is.na(x) && !x } diff --git a/inst/tinytest/test-mo_property.R b/inst/tinytest/test-mo_property.R index b5118733..438bea66 100644 --- a/inst/tinytest/test-mo_property.R +++ b/inst/tinytest/test-mo_property.R @@ -25,7 +25,7 @@ expect_equal(mo_kingdom("Escherichia coli"), "Bacteria") expect_equal(mo_kingdom("Escherichia coli"), mo_domain("Escherichia coli")) -expect_equal(mo_phylum("Escherichia coli"), "Proteobacteria") +expect_equal(mo_phylum("Escherichia coli"), "Pseudomonadota") expect_equal(mo_class("Escherichia coli"), "Gammaproteobacteria") expect_equal(mo_order("Escherichia coli"), "Enterobacterales") expect_equal(mo_family("Escherichia coli"), "Enterobacteriaceae") @@ -64,7 +64,7 @@ expect_equal(mo_ref("Escherichia coli"), "Castellani et al., 1919") expect_equal(mo_authors("Escherichia coli"), "Castellani et al.") expect_equal(mo_year("Escherichia coli"), 1919) -expect_true(mo_url("Candida albicans") %like% "catalogueoflife.org") +expect_true(mo_url("Candida albicans") %like% "gbif.org") expect_true(mo_url("Escherichia coli") %like% "lpsn.dsmz.de") # test integrity @@ -84,11 +84,12 @@ expect_stdout(print(mo_gramstain("Escherichia coli", language = "it"))) expect_stdout(print(mo_gramstain("Escherichia coli", language = "fr"))) expect_error(mo_gramstain("Escherichia coli", language = "UNKNOWN")) -dutch <- mo_name(microorganisms$fullname, language = "nl") # should be transformable to English again -expect_identical(mo_name(dutch, language = NULL), microorganisms$fullname) # gigantic test - will run ALL names +dutch <- mo_name(microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase")], language = "nl") # should be transformable to English again +expect_identical(mo_name(dutch, language = NULL), + microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase")]) # gigantic test - will run ALL names # manual property function -expect_error(mo_property("Escherichia coli", property = c("tsn", "fullname"))) +expect_error(mo_property("Escherichia coli", property = c("genus", "fullname"))) expect_error(mo_property("Escherichia coli", property = "UNKNOWN")) expect_identical( mo_property("Escherichia coli", property = "fullname"), diff --git a/tests/tinytest.R b/tests/tinytest.R index ac9fd997..8e5ae6d1 100644 --- a/tests/tinytest.R +++ b/tests/tinytest.R @@ -49,7 +49,7 @@ if (identical(Sys.getenv("R_RUN_TINYTEST"), "true")) { strrep <- AMR:::strrep trimws <- AMR:::trimws } - if (getRversion() < "3.4.2") { + if (getRversion() < "3.5.0") { isFALSE <- AMR:::isFALSE } if (getRversion() < "3.6.0") {