-
Notifications
You must be signed in to change notification settings - Fork 19
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
double() fails if script director uses method with user-defined default arguments #308
Comments
Seems like Godot's Haha, just saw that GUT also opened an issue on this: bitwes/Gut#263. They have a stub that can specify default arguments, but I don't like that idea of letting the user modify the method signature here because it weakens the purpose of a double. Might as well write a short and simple mock class at that point, which is always a valid workaround. I suggest we keep this issue open until the PR is merged into Godot 4.0 and its release, and then we can make sure it works there. Alternatively, we can write our own script reader - or some kind of intermediary parser for method declarations only so that the default arguments can be added in, but that's overkill in my opinion. |
I have a lot of plans for 4.0 but want to focus issues on 3.X.X for now so I'm going to close this and marked it as a benched so we know to come back to it. |
Reopening unresolved issue. A note: Considering writing test doubles as separate plugin that can be used in conjunction with WAT rather than a core feature of WAT which should hypothetically allow for a more robust Test Double system. |
I've been thinking about this. A large problem was that previously it would have been hard to find which script this method existed in, which means the script we would be parsing for the defaults might not have the function at all. However thanks to the event of get_script_method_list(), it seems we'll be able to loop to the correct script to double the method. then do a source.split("\n") or some form of regex(func name(*)) and then parse the paranthesis. We'd likely focus on doubling primitive defaults for now though. |
Finally resolved by #373 Inner Classes are still limited but that cost-value ratio just isn't worth it for now, so optional keywords and retvals are kept in. |
Issue description
WAT Version: 6.0.0
Godot Version: 3.3.4
OS: Windows 10
Steps to reproduce the issue
What's the expected result?
Tests should pass.
What's the actual result?
The text was updated successfully, but these errors were encountered: