-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GnoVM] TestSetRealm
not working properly in gno test
#2371
Comments
TestSetRealm
not working properlyTestSetRealm
not working properly in gno test
see-also
|
The problem concerns using TestSetRealm in p/. See the following commit, where the tests succeed: 799ed1c Note that the solution to making TestSetRealm work in p/, is by making the call pass through another "mocked realm" first:
This is because of the way TestSetRealm works, which I don't think is entirely incorrect. The "Realm" changes only when a realm boundary is crossed; so if we're working with packages, it doesn't. Consequently, in the example you provided @leohhhn, calling PrevRealm will yield the OrigCaller, because the CurrentRealm is the one you set with TestSetRealm. I'm considering whether to just make TestSetRealm set both CurrentRealm and PrevRealm, when called from a package. Packages cannot import realms, so this may be OK. Need to sleep on it, though. |
I plan to tackle this in a different way in #2425, with the ability to set both PrevRealm and CurrentRealm when creating a context, so that pure package testing can work properly |
Description
Example package:
Example tests:
Both tests fail with:
The text was updated successfully, but these errors were encountered: