(v3.0.1.9032) fix unit tests

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2026-03-08 20:36:15 +01:00
1 parent b6f8584994
commit cba315c2e7
4 files changed
+12 -6

No files matched your search

+9 -3
View File
@@ -178,9 +178,15 @@ test_that("test-zzz.R", {
also_load = FALSE,
min_version = if (pkg == "dplyr") "1.0.0" else NULL
)) {
expect_true(!is.null(AMR:::import_fn(name = fn, pkg = pkg, error_on_fail = FALSE)),
info = paste0("Function does not exist (anymore): function `", pkg, "::", fn, "()`")
)
if (pkg == "rstudioapi") {
expect_true(is.function(tryCatch(get(fn, envir = asNamespace(pkg)), error = function(e) NULL)),
info = paste0("Function does not exist (anymore): function `", pkg, "::", fn, "()`")
)
} else {
expect_true(!is.null(AMR:::import_fn(name = fn, pkg = pkg, error_on_fail = FALSE)),
info = paste0("Function does not exist (anymore): function `", pkg, "::", fn, "()`")
)
}
} else if (pkg != "rstudioapi") {
warning("Package '", pkg, "' not available")
}