R Under development (unstable) (2023-11-06 r85483 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## These tests need to be last of all tests, otherwise > ## covr::package_coverage() gives an error. > cat("1. Loading package\n") 1. Loading package > loadNamespace("matrixStats") > stopifnot("matrixStats" %in% loadedNamespaces()) > > cat("2. Unloading package\n") 2. Unloading package > unloadNamespace("matrixStats") > stopifnot(!"matrixStats" %in% loadedNamespaces()) > > if (FALSE) { + ## 'covr' gives "Error in library("matrixStats") : + ## there is no package called 'matrixStats'" here, cf. + ## https://travis-ci.org/HenrikBengtsson/matrixStats/builds/48015577 + + cat("3. Attaching package\n") + library("matrixStats") + stopifnot("package:matrixStats" %in% search()) + + cat("4. Detaching package\n") + detach("package:matrixStats") + stopifnot(!"package:matrixStats" %in% search()) + stopifnot("matrixStats" %in% loadedNamespaces()) + + cat("5. Unloading package\n") + unloadNamespace("matrixStats") + stopifnot(!"matrixStats" %in% loadedNamespaces()) + + cat("6. Attaching package (again)\n") + library("matrixStats") + stopifnot("package:matrixStats" %in% search()) + + cat("7. Detaching package (again)\n") + detach("package:matrixStats") + stopifnot(!"package:matrixStats" %in% search()) + stopifnot("matrixStats" %in% loadedNamespaces()) + } > > cat("7. DONE\n") 7. DONE > > proc.time() user system elapsed 0.14 0.01 0.14