R Under development (unstable) (2024-05-17 r86565 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 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. > source(file.path("_helper", "init.R")) > > # Most tests involving global are scattered all over the place, just putting a > # few extra ones that are very specifically about global here > # > # - "Singleton Implementation Working" ----------------------------------------- > > invisible(unitizer:::unitizerGlobal$new()) # warn Warning in .Object$initialize(...) : Instantiated global object without global namespace registry; you should only see this warning you are using `repair_environments`. > glob.first <- unitizer:::unitizerGlobal$new(set.global = TRUE) > try(unitizer:::unitizerGlobal$new(set.global = TRUE)) Error in .Object$initialize(...) : Internal Error: global tracking object already exists; this should never happen; contact maintainer > try(unitizer:::unitizerGlobal$new()) Error in .Object$initialize(...) : Internal Error: global tracking object already exists; this should never happen; contact maintainer > glob.first$release() > > # - "Dummy Display" ------------------------------------------------------------ > > show(new("unitizerDummy")) # not recorded > > # - "Disable / Enable" --------------------------------------------------------- > > suppressWarnings(glob <- unitizer:::unitizerGlobal$new()) > glob$disable() An object of class "unitizerGlobalStatus" Slot "search.path": [1] 0 Slot "options": [1] 0 Slot "working.directory": [1] 0 Slot "random.seed": [1] 0 Slot "namespaces": [1] 0 > glob$enable(c(search.path = 2L)) # warn state setting Warning in glob$enable(c(search.path = 2L)) : State setting for `search.path` has already been disabled and cannot be re-enabled An object of class "unitizerGlobalStatus" Slot "search.path": [1] 0 Slot "options": [1] 0 Slot "working.directory": [1] 0 Slot "random.seed": [1] 0 Slot "namespaces": [1] 0 > > > proc.time() user system elapsed 0.42 0.10 0.51