1
0
mirror of https://github.com/msberends/AMR.git synced 2026-03-11 17:47:50 +01:00

(v3.0.1.9032) fix unit tests

This commit is contained in:
2026-03-08 20:36:15 +01:00
parent b6f8584994
commit cba315c2e7
4 changed files with 12 additions and 6 deletions

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")
}