Closed connectedblue closed 7 years ago
I get a failure on the test:
1. Failure: running clear() removes variables beginning with a dot (except the config$sticky_variables) (@test-clear.R#218) -----------------------------------------------------------------------
`messages` does not match "clear from memory: .xxx".
Actual value: "Objects to clear from memory: config .xxx\n"
@Hugovdberg Is this test failure still happening? Did you find the cause or fix?
This PR enables all variables to be removed from the global environment by
clear()
including those beginning with a dot (except if they are protected byconfig$sticky_vars
).This assists with some hard-to-track bugs where there is a
.variable
in global env that conflicts with something in a package, and the package value is masked by precedence. You can't necessarily see these variables by default usingls()
. Also, if you use RStudio, it saves a snapshot of global env across restarts perpetuating the problem.I'm pretty sure this happened to me when working on #163. Tests passed on my local machine but not travis - I was missing a function
.var.diff.from
in the package which was being masked because it was lurking in the global environment.I added a small documentation update on the man page and also some regression tests.