From 92166c16e82b6334fad7e9db659d2d5eb96a90b3 Mon Sep 17 00:00:00 2001 From: Matthijs Berends Date: Mon, 27 Jan 2025 16:34:26 +0100 Subject: [PATCH] fix2 --- inst/tests/test-_misc.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inst/tests/test-_misc.R b/inst/tests/test-_misc.R index 05f26b83a..2e5544edb 100755 --- a/inst/tests/test-_misc.R +++ b/inst/tests/test-_misc.R @@ -27,13 +27,13 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -tryCatch(!is.function(expect_stout), error = function(e) TRUE) { +if (tryCatch(!is.function(expect_stout), error = function(e) TRUE)) { expect_stout <<- testthat::expect_output } -tryCatch(!is.function(expect_inherits), error = function(e) TRUE) { +if (tryCatch(!is.function(expect_inherits), error = function(e) TRUE)) { expect_inherits <<- function(x, y, ...) testthat::expect(inherits(x, y), - failure_message = paste0("Expected class ", paste(y, collapse = "/"), - ", got class ", paste(class(x), collapse = "/"))) + failure_message = paste0("Expected class ", paste(y, collapse = "/"), + ", got class ", paste(class(x), collapse = "/"))) } expect_equal(AMR:::percentage(0.25), "25%")