@@ -28,7 +28,7 @@ isBotchedSession <- function()
2828 assignAs
2929}
3030
31- .DummyModule <- function (name , what ) {
31+ .DummyModule <- function (name , what ) { # #nocov start
3232 value <- new.env()
3333 storage <- new.env()
3434 assign(" storage" , storage , envir = value )
@@ -37,7 +37,7 @@ isBotchedSession <- function()
3737 for (el in allNames )
3838 assign(el , NULL , envir = storage )
3939 value
40- }
40+ } # #nocov end
4141
4242.moduleMetaName <- function (name )
4343 methods :: methodsPackageMetaName(" Mod" ,name )
@@ -54,9 +54,9 @@ loadModule <- function( module, what = character(), loadNow,
5454 if (exists(metaName , envir = env , inherits = FALSE ))
5555 loadM <- get(metaName , envir = env )
5656 }
57- else if (is(module , " Module" )) {
58- loadM <- as.environment(module )
59- module <- get(loadM , " moduleName" )
57+ else if (is(module , " Module" )) {
58+ loadM <- as.environment(module ) # #nocov
59+ module <- get(loadM , " moduleName" ) # #nocov
6060 }
6161 else
6262 stop(gettextf(" Argument \" module\" should be a module or the name of a module: got an object of class \" %s\" " , class(module )))
@@ -74,10 +74,10 @@ loadModule <- function( module, what = character(), loadNow,
7474 loadM <- tryCatch(Module( module , mustStart = TRUE , where = env ),
7575 error = function (e )e )
7676 if (is(loadM , " error" )) {
77- if (.botched )
77+ if (.botched ) # #nocov start
7878 return (.DummyModule(module , what ))
7979 stop(gettextf(" Unable to load module \" %s\" : %s" ,
80- as(module , " character" ), loadM $ message ))
80+ as(module , " character" ), loadM $ message )) # #nocov end
8181 }
8282 if (! exists(metaName , envir = env , inherits = FALSE ))
8383 assign(metaName , loadM , envir = env )
@@ -90,7 +90,7 @@ loadModule <- function( module, what = character(), loadNow,
9090 what <- objects(storage )
9191 missingObjs <- ! sapply(what , function (symb ) exists(symb , envir = storage , inherits = FALSE ))
9292 if (any(missingObjs )) {
93- if (.botched ) {
93+ if (.botched ) { # #nocov start
9494 for (el in what [missingObjs ])
9595 assign(el , NULL , envir = storage )
9696 }
@@ -99,7 +99,7 @@ loadModule <- function( module, what = character(), loadNow,
9999 paste0(' "' , what [missingObjs ], ' "' , collapse = " , " ),
100100 as.character(module )))
101101 what <- what [! missingObjs ]
102- }
102+ } # #nocov end
103103 }
104104 assignAs <- .moduleNames(what )
105105 for ( i in seq_along(what ) ) {
@@ -117,7 +117,7 @@ loadModule <- function( module, what = character(), loadNow,
117117 myCall $ loadNow <- TRUE
118118 body(f , envir = env ) <- myCall
119119 setLoadAction(f , where = env )
120- invisible (myCall )
120+ invisible (myCall ) # #nocov
121121 }
122122}
123123
0 commit comments