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
GD-42: Rewrite doubler to allow double core functions #42
Comments
I'm having a lot of behavior issues with mocks even with custom functions of my classes. is this expected? I don't see signals using the double code, but I also have issues with getting that to work. |
Hello, I am back from vacation. As the issue describes, core functions are current not possible to override, this is how GDScript 2.0 now works. Custom functions should still be mockable. |
Oh man, I just realized Im talking to the same person from Godot engine GitHub issue page about event propagation. :) i apologize if I'm clouding the water over there I am using your unit test framework and removing the check to run headless for my ci. Anyway, I've done a little more trouble shooting and I think there is an issue with returning a custom value and using the "any" matchers. If I setup the do_return on the mock with the same argument values expected, values passed by the tested class, then it will return the custom value. If I use the any matchers then I will only get the default return. This issue may be different then this one, if I have time I can create a separate issue. Thanks |
if you found such issues about mocking please create an new bug issue with steps to reproduce, this will help me to shedule the fix. Thanks |
@MikeSchulze Discovering GdUnit4 was exciting, offering a valuable solution for testing my C# Godot4 game through its sleek test runner and plugin. However, my enthusiasm was tempered upon realizing that the mocking/spying feature is exclusively available for GdScript, as illustrated in this example. This limitation presents a significant drawback for me, given that mocking and spying are fundamental concepts in testing, and their absence in C# testing diminishes the utility of GdUnit4 for my specific needs. I acknowledge the positive step in addressing this concern with the statement:
However, I believe that rectifying this limitation for C# should be given higher priority. |
Thanks for your feedback, that is very valuable for me. |
Describe What
GdUnit4 no longer works to mock/spy on core functions.
Describe Why
With Godot 4 it is no longer allowed to override core functions which breaks the current doubler implementation.
Dev hints
Follow the new double prototype to allow double core functions.
@warning_ignore("native_method_override")
Godot Issues:
godotengine/godot#55024
godotengine/godot#67461
The text was updated successfully, but these errors were encountered: