isolate tests.Rraw from variables created by user in .GlobalEnv #5101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #3705
Could change
z
to be an unusual name such asfoo6937265
and skip the test in the unusual case that even that was in .GlobalEnv. However, trying to tackle the root cause by changing the parent of the env that tests run inside, so we never have this issue again.First commit set parent to
parent.env(.GlobalEnv)
which issearch()[2]
. This worked in that test 1894 no longer sees thez
in.GlobalEnv
. However, then other tests which loadbit64
fail because when they are loaded at the top of tests.Rraw they become the new position 2 and functions likeas.integer64()
are not found because the parent of the env is now position 3 (the old position 2).Hence tests.Rraw now attaches suggests at the end of
search()
.