9.7.0
Breaking Changes
Godot 4.7 introduced more restrictive type checking for return values. In prior releases Doubles could return null regardless of the declared return type of the function. Doubles have been adjusted to return a default value for each TYPE_ constant. This may cause false postives/negatives in existing and new tests if you do not take this into account.
You can find a complete list of the default values at https://gut.readthedocs.io/en/latest/Doubles.html
When a method is stubbed to return an invalid value GUT will generate an error but execution will continue. This will result in an engine error as well.
Gut Error Example:
[GUT ERROR]: Method [explicit_int_return] was stubbed to return invalid value [adsf].
Engine Error Example:
SCRIPT ERROR: Trying to return a value of type "String" from a function whose return type is "int".
stub(...).to_do_nothing() now stubs the method to return the default value for the return type of the function.
Features
- Compatibility changes for Godot 4.7.
Change Log
- Update detection by @bitwes in #815
- updated message, fixed null errors when loading canceled by @bitwes in #817
- clip controls and custom minimum size by @bitwes in #818
- Update gdscript_native_class_names_by_type in GutUtils by @Curtis-Barnhart in #810
- Fix a typo and a grammar mistake in docs by @Mitten-O in #809
- add _to_string to blacklist by @bitwes in #819
- Add documentation for setting global per-test hooks in pre-run hook by @Curtis-Barnhart in #804
- I824 orphans after all by @bitwes in #825
New Contributors
- @Mitten-O made their first contribution in #809
Full Changelog: v9.6.0...v9.7.0