-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add proper method to access scope root object #85
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validations are a nice improvement over the direct dereference; although it "probably" gets called in other test cases where failure would be detected, an explicit "pass" test case would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks generally good, but I don't think we should be panicking as a result of bad user input...and I have a couple of other comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case_mismatched_root:
root: wrong
objects:
a:
id: a
case_mismatched_root_id:
root: a
objects:
a:
id: wrong
case3:
root: a
objects:
wrong:
id: a
The first two cases are what I believe your unit tests are addressing. Is case3
more so an issue with Object
construction than Scope
construction?
The last one is also a scope problem, because "wrong" is a key in the scope map. It doesn't match the object ID of "a". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had written this earlier, but couldn't post it because of a Github error.
Changes introduced with this PR
This method adds validation for accessing the scope's root, and can be used outside of the SDK. It validates three possible mistakes.
There are three potential places to use this in the engine that I will need to address later.
By contributing to this repository, I agree to the contribution guidelines.