Completion Tests: Add script to owner #89884
Merged
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.
While creating tests for the argument option completion the following problem came to light:
It is impossible to load the test scripts in a scene file, since they are not valid. That means, that the base value for completion does not reflect the members of the script.
To solve that I choose the following solution:
It is now a requirement, that the test scripts are valid, after the line which contains the indicator is removed. The completion test runner will construct a valid script under this assumption and automatically add it to the owner in the scene. This replicates the real situation when you have a valid script and start typing new code which gets auto completion.
All existing tests were adjusted to meet this criteria. I currently know of one PR which adds completion tests: #89382. If this PR is merged before this one I'll adjust the tests as well.