R Under development (unstable) (2025-04-15 r88147 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 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. > ## This runs testme test script inst/testme/test-Globals.R > ## Don't edit - it was autogenerated by inst/testme/deploy.R > globals:::testme("Globals") Test 'Globals' ... Sourcing 9 prologue scripts ... 01/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/_prologue/001.load.R' 02/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/_prologue/005.globals.R' 03/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/_prologue/010.record-state.R' 04/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/_prologue/030.imports.R' 05/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/_prologue/050.utils.R' 06/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/_prologue/090.context.R' 07/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/_prologue/090.options.R' 08/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/_prologue/091.envvars.R' 09/09 prologue script 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/_prologue/995.detrius-connections.R' Sourcing 9 prologue scripts ... done Running test script: 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/test-Globals.R' > library(globals) > assert_attributes <- function(globals) { + attrs <- attributes(globals) + names <- names(attrs) + stopifnot(length(attrs) >= 2, "class" .... [TRUNCATED] > a <- 1 > b <- 2 > message("*** Globals() ...") *** Globals() ... > globals0 <- globalsByName(c("a", "rnorm")) > globals <- globals0 > str(globals) List of 2 $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) - attr(*, "where")=List of 2 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 2, length(where) == length(globals), all(names(globals) == + c("a", "rnorm")), .... [TRUNCATED] > message("*** Globals() - names ...") *** Globals() - names ... > globals <- globals0 > str(globals) List of 2 $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) - attr(*, "where")=List of 2 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 2, length(where) == length(globals), all(names(globals) == + c(names(globals0)) .... [TRUNCATED] > names(globals)[1] <- "A" > str(globals) List of 2 $ A : num 1 $ rnorm:function (n, mean = 0, sd = 1) - attr(*, "where")=List of 2 ..$ A : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 2, length(where) == length(globals), all(names(globals) == + c("A", names(globa .... [TRUNCATED] > message("*** Globals() - names ... DONE") *** Globals() - names ... DONE > message("*** Globals() - subsetting ...") *** Globals() - subsetting ... > globals <- globals0[1] > str(globals) List of 1 $ a: num 1 - attr(*, "where")=List of 1 ..$ a: - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 1, length(where) == length(globals), all(names(globals) == + c("a")), all(names .... [TRUNCATED] > globals <- globals0[2] > str(globals) List of 1 $ rnorm:function (n, mean = 0, sd = 1) - attr(*, "where")=List of 1 ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 1, length(where) == length(globals), all(names(globals) == + c("rnorm")), all(n .... [TRUNCATED] > globals <- globals0[2:1] > str(globals) List of 2 $ rnorm:function (n, mean = 0, sd = 1) $ a : num 1 - attr(*, "where")=List of 2 ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" ..$ a : - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 2, length(where) == length(globals), all(names(globals) == + c("rnorm", "a")), .... [TRUNCATED] > globals <- rev(globals0) > str(globals) List of 2 $ rnorm:function (n, mean = 0, sd = 1) $ a : num 1 - attr(*, "where")=List of 2 ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" ..$ a : - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 2, length(where) == length(globals), all(names(globals) == + rev(names(globals0 .... [TRUNCATED] > message("*** Globals() - subsetting ... DONE") *** Globals() - subsetting ... DONE > message("*** Globals() - subsetted assignment ...") *** Globals() - subsetted assignment ... > message("1.") 1. > globals <- globals0 > globals$a <- globals0["a"] > str(globals) List of 2 $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) - attr(*, "where")=List of 2 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 2, length(where) == length(globals), all(names(globals) == + names(globals0)), .... [TRUNCATED] > message("2.") 2. > globals <- globals0 > globals[["a"]] <- globals0["a"] > str(globals) List of 2 $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) - attr(*, "where")=List of 2 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 2, length(where) == length(globals), all(names(globals) == + names(globals0)), .... [TRUNCATED] > message("3.") 3. > globals <- globals0 > globals$b <- globals0["a"] > str(globals) List of 3 $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) $ b : num 1 - attr(*, "where")=List of 3 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" ..$ b : - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 3, length(where) == length(globals), all(names(globals) == + c(names(globals0), .... [TRUNCATED] > message("4.") 4. > globals <- globals0 > globals[["b"]] <- globals0["a"] > str(globals) List of 3 $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) $ b : num 1 - attr(*, "where")=List of 3 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" ..$ b : - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 3, length(where) == length(globals), all(names(globals) == + c(names(globals0), .... [TRUNCATED] > message("5.") 5. > globals <- globals0 > globals["b"] <- globals0["a"] > str(globals) List of 3 $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) $ b : num 1 - attr(*, "where")=List of 3 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" ..$ b : - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 3, length(where) == length(globals), all(names(globals) == + c(names(globals0), .... [TRUNCATED] > message("6.") 6. > globals <- globals0 > globals["b"] <- list(globals0[["a"]]) > str(globals) List of 3 $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) $ b : num 1 - attr(*, "where")=List of 3 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" ..$ b : - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 3, length(where) == length(globals), all(names(globals) == + c(names(globals0), .... [TRUNCATED] > message("7.") 7. > globals <- globals0 > globals$a <- NULL > str(globals) List of 1 $ rnorm:function (n, mean = 0, sd = 1) - attr(*, "where")=List of 1 ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 1, length(where) == length(globals), all(names(globals) == + names(globals0)[-1 .... [TRUNCATED] > message("8.") 8. > globals <- globals0 > globals$a <- 1:2 > str(globals) List of 2 $ a : int [1:2] 1 2 $ rnorm:function (n, mean = 0, sd = 1) - attr(*, "where")=List of 2 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 2, length(where) == length(globals), all(names(globals) == + names(globals0)), .... [TRUNCATED] > message("9.") 9. > globals <- globals0 > globals[c("b", "a")] <- list(1:3, 42) > str(globals) List of 3 $ a : num 42 $ rnorm:function (n, mean = 0, sd = 1) $ b : int [1:3] 1 2 3 - attr(*, "where")=List of 3 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" ..$ b : - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 3, length(where) == length(globals), all(names(globals) == + c(names(globals0), .... [TRUNCATED] > message("10.") 10. > globals <- Globals() > globals["empty"] <- list(NULL) > str(globals) List of 1 $ empty: NULL - attr(*, "where")=List of 1 ..$ empty: - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 1, length(where) == length(globals), all(names(globals) == + "empty"), is.null( .... [TRUNCATED] > message("*** Globals() - subsetted assignment ... DONE") *** Globals() - subsetted assignment ... DONE > message("*** Globals() - combining ...") *** Globals() - combining ... > globals_a <- globals0[1:2] > globals_b <- globals0[1:2] > globals <- c(globals_a, globals_b) > str(globals) List of 4 $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) - attr(*, "where")=List of 4 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 4, length(where) == length(globals), all(names(globals) == + c(names(globals_a) .... [TRUNCATED] > globals_a <- globals0[1:2] > globals_b <- list(b = 1, c = letters) > globals <- c(globals_a, globals_b) > str(globals) List of 4 $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) $ b : num 1 $ c : chr [1:26] "a" "b" "c" "d" ... - attr(*, "where")=List of 4 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" ..$ b : ..$ c : - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 4, length(where) == length(globals), all(names(globals) == + c(names(globals_a) .... [TRUNCATED] > globals_a <- globals0[1:2] > globals_b <- list() > globals <- c(globals_a, globals_b) > str(globals) List of 2 $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) - attr(*, "where")=List of 2 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 2, length(where) == length(globals), all(names(globals) == + c(names(globals_a) .... [TRUNCATED] > globals_a <- globals0[1:2] > globals <- c(globals_a, b = 1, c = letters) > str(globals) List of 4 $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) $ b : num 1 $ c : chr [1:26] "a" "b" "c" "d" ... - attr(*, "where")=List of 4 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" ..$ b : ..$ c : - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 4, length(where) == length(globals), all(names(globals) == + c(names(globals_a) .... [TRUNCATED] > globals <- Globals() > globals_1 <- c(globals, fcn = median) > str(globals_1) List of 1 $ fcn:function (x, na.rm = FALSE, ...) - attr(*, "where")=List of 1 ..$ fcn: - attr(*, "class")= chr [1:2] "Globals" "list" > globals_2 <- globals > globals_2$fcn <- median > str(globals_2) List of 1 $ fcn:function (x, na.rm = FALSE, ...) - attr(*, "where")=List of 1 ..$ fcn: - attr(*, "class")= chr [1:2] "Globals" "list" > stopifnot(identical(globals_2, globals_1)) > message("*** Globals() - combining ... DONE") *** Globals() - combining ... DONE > message("*** Globals() - unique ...") *** Globals() - unique ... > globals <- globals0[c(1:2, 1:2, 1:2)] > str(globals) List of 6 $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) - attr(*, "where")=List of 6 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 6, length(where) == length(globals), all(names(globals) == + rep(names(globals0 .... [TRUNCATED] > globals <- unique(globals) > str(globals) List of 2 $ a : num 1 $ rnorm:function (n, mean = 0, sd = 1) - attr(*, "where")=List of 2 ..$ a : ..$ rnorm: .. ..- attr(*, "name")= chr "package:stats" .. ..- attr(*, "path")= chr "D:/RCompile/recent/R/library/stats" - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + length(globals0), length(where) == length(globals), all(names(globals) == + nam .... [TRUNCATED] > message("*** Globals() - unique ... DONE") *** Globals() - unique ... DONE > message("*** Globals() - coercion ...") *** Globals() - coercion ... > globals <- as.Globals(globals0) > stopifnot(assert_attributes(globals), identical(globals, + globals0)) > globals <- as.Globals(unclass(globals0)) > stopifnot(assert_attributes(globals), identical(globals, + globals0)) > globals_t <- unclass(globals0) > attr(globals_t, "where") <- NULL > globals <- as.Globals(globals_t) > stopifnot(assert_attributes(globals), length(globals) == + length(globals0), names(globals) == names(globals0)) > message("*** Globals() - coercion ... DONE") *** Globals() - coercion ... DONE > message("*** Globals() - empty ...") *** Globals() - empty ... > globals <- Globals() > stopifnot(assert_attributes(globals), length(globals) == + 0) > globals <- Globals(list()) > stopifnot(assert_attributes(globals), length(globals) == + 0) > globals <- as.Globals(list()) > stopifnot(assert_attributes(globals), length(globals) == + 0) > message("*** Globals() - empty ... DONE") *** Globals() - empty ... DONE > message("*** Globals() - NULL ...") *** Globals() - NULL ... > denv <- getOption("globals.environment_of.default", + emptyenv()) > globals <- as.Globals(list(a = NULL)) > str(globals) List of 1 $ a: NULL - attr(*, "where")=List of 1 ..$ a: - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 1, length(where) == length(globals), all(names(where) == + names(globals)), ide .... [TRUNCATED] > globals <- c(Globals(), list(a = NULL)) > str(globals) List of 1 $ a: NULL - attr(*, "where")=List of 1 ..$ a: - attr(*, "class")= chr [1:2] "Globals" "list" > where <- attr(globals, "where") > stopifnot(assert_attributes(globals), length(globals) == + 1, length(where) == length(globals), all(names(where) == + names(globals)), ide .... [TRUNCATED] > message("*** Globals() - NULL ... DONE") *** Globals() - NULL ... DONE > message("*** Globals() - exceptions ...") *** Globals() - exceptions ... > res <- tryCatch({ + Globals(NULL) + }, error = identity) > stopifnot(inherits(res, "simpleError")) > res <- tryCatch({ + Globals(list(1, 2)) + }, error = identity) > stopifnot(inherits(res, "simpleError")) > res <- tryCatch({ + Globals(list(a = 1, 2)) + }, error = identity) > stopifnot(inherits(res, "simpleError")) > globals <- globals0 > res <- tryCatch({ + globals$a <- globals0[2:1] + }, error = identity) > stopifnot(inherits(res, "simpleError")) > res <- tryCatch({ + c(globals0, 2) + }, error = identity) > stopifnot(inherits(res, "simpleError")) > message("*** Globals() - exceptions ... DONE") *** Globals() - exceptions ... DONE > message("*** Globals() ... DONE") *** Globals() ... DONE Sourcing 5 epilogue scripts ... 01/05 epilogue script 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/_epilogue/002.undo-state.R' Failed to undo environment variables: - Expected environment variables: [n=207] '!ExitCode', 'ALLUSERSPROFILE', 'APPDATA', ..., 'tempdirname' - Environment variables still there: [n=0] - Environment variables missing: [n=1] 'MAKEFLAGS' Differences environment variable by environment variable: 02/05 epilogue script 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/_epilogue/090.gc.R' 03/05 epilogue script 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/_epilogue/099.session_info.R' 04/05 epilogue script 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/_epilogue/995.detritus-connections.R' 05/05 epilogue script 'D:/RCompile/CRANincoming/R-devel/lib/globals/testme/_epilogue/999.detritus-files.R' Skipping, because path appears not to be an 'R CMD check' folder: 'D:/temp/2025_04_16_07_20_17_20184' Sourcing 5 epilogue scripts ... done Test time: user.self=0.2s, sys.self=0.02s, elapsed=0.2s, user.child=NAs, sys.child=NAs Test 'Globals' ... success > > proc.time() user system elapsed 0.46 0.06 0.50