You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When mocking a gdscript class that use property syntax ie:
var _some_var: bool:
get:
return true
The mocked object gets a script file generated with a function name that the gdscript parser doesnt recognize resulting in a null value being returned to caller of mock()
Steps to Reproduce
Example:
Open the application.
Create a new script with the property syntax above
Mock that script via the mock method in gdUnit4
Debug OR Run tests
Observe error in Godot debugger if tests were debugged OR Observer error in gdUnitConsole if tests were run
If the issue involves code, please include relevant snippets below:
MikeSchulze
changed the title
GD-XXX: Mocked scripts with property syntax result invalid gdscript
GD-594: Mocked scripts with property syntax result invalid gdscript
Nov 6, 2024
# Why
see #594
# What
There was a bug in the script parser using hard coded check for getter/setter parameter named `type`.
Fixed by using a pattern to detect a getter/setter matching.
# Why
see #594
# What
There was a bug in the script parser using hard coded check for
getter/setter parameter named `type`. Fixed by using a pattern to detect
a getter/setter matching.
The used GdUnit4 version
4.4.0 (Latest Release)
The used Godot version
v4.3-stable
Operating System
Windows 11
Describe the bug
When mocking a gdscript class that use property syntax ie:
The mocked object gets a script file generated with a function name that the gdscript parser doesnt recognize resulting in a null value being returned to caller of
mock()
Steps to Reproduce
Example:
mock
method in gdUnit4If the issue involves code, please include relevant snippets below:
Example script with property syntax
Results in a mock generated with following function
FWIW I am able to get around this by patching gdunit4 locally to ignore descriptors that start with
"@"
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: