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-formulas.R > ## Don't edit - it was autogenerated by inst/testme/deploy.R > globals:::testme("formulas") Test 'formulas' ... 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-formulas.R' > library(globals) > message("findGlobals() with formula ...") findGlobals() with formula ... > g <- findGlobals(. ~ x + y:z, substitute = TRUE) > print(g) [1] "~" "." "+" "x" ":" "y" "z" > assert_identical_sets(g, c("~", ".", "+", "x", ":", + "y", "z")) > g <- findGlobals(map(1, ~typeof(.x)), substitute = TRUE) > print(g) [1] "map" "~" "typeof" ".x" > assert_identical_sets(g, c("map", "~", "typeof", ".x")) > message("- findGlobals() with NULL in the formula ...") - findGlobals() with NULL in the formula ... > for (substitute in c(TRUE, FALSE)) { + message("- substitute = ", substitute) + g <- findGlobals(. ~ NULL, substitute = substitute) + pr .... [TRUNCATED] - substitute = TRUE [1] "~" "." [1] "~" [1] "~" [1] "~" "." - substitute = FALSE [1] "~" "." [1] "~" [1] "~" [1] "~" "." > message("- findGlobals() with ellipsis in formulas ...") - findGlobals() with ellipsis in formulas ... > g <- findGlobals(list(..., ..3) ~ list(., .x, ..., + ..1, ..2)) > print(g) [1] "~" "list" "..." "..3" "." ".x" "..1" "..2" > assert_identical_sets(g, c("~", "list", "...", "..3", + ".", ".x", "..1", "..2")) > message("- findGlobals() with NULL in formulas ...") - findGlobals() with NULL in formulas ... > env <- new.env(parent = globalenv()) > env$`~` <- function(...) "OVERRIDE!" > x <- ~NULL > g <- eval(quote(findGlobals(x)), env) > assert_identical_sets(g, "~") > x <- list(~NULL) > g <- eval(quote(findGlobals(x)), env) > assert_identical_sets(g, "~") > x <- list(NULL ~ NULL) > g <- eval(quote(findGlobals(x)), env) > assert_identical_sets(g, "~") > x <- list(NULL ~ b) > g <- eval(quote(findGlobals(x)), env) > assert_identical_sets(g, c("~", "b")) > message("findGlobals() with formula ... DONE") findGlobals() with formula ... DONE > message("globalsOf() with formula ...") globalsOf() with formula ... > foo <- function(x) { + map(1, ~typeof(x + .x)) + } > g <- globalsOf(foo(1), substitute = TRUE, mustExist = FALSE) > str(g) List of 8 $ foo :function (x) $ { :.Primitive("{") $ map : NULL $ ~ :.Primitive("~") $ typeof:function (x) $ + :function (e1, e2) $ x :List of 1 ..$ :Class 'formula' language NULL ~ b .. .. ..- attr(*, ".Environment")= $ .x : NULL - attr(*, "where")=List of 8 ..$ foo : ..$ { : ..$ map : NULL ..$ ~ : ..$ typeof: ..$ + : ..$ x : ..$ .x : NULL - attr(*, "class")= chr [1:2] "Globals" "list" > assert_identical_sets(names(g), c("foo", "map", "{", + "~", "typeof", "+", "x", ".x")) > message("globalsOf() with formula ... DONE") globalsOf() with formula ... 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.1s, sys.self=0s, elapsed=0.1s, user.child=NAs, sys.child=NAs Test 'formulas' ... success > > proc.time() user system elapsed 0.28 0.10 0.37