From 00604bb80305e08aaafe0aaeed3dc840ee1b223d Mon Sep 17 00:00:00 2001 From: Marvin Ewald Date: Sat, 6 Apr 2024 23:52:25 +0200 Subject: [PATCH] Improve static typing support --- addons/gut/gut.gd | 3 ++- addons/gut/test.gd | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/gut/gut.gd b/addons/gut/gut.gd index 60569803..04a88525 100644 --- a/addons/gut/gut.gd +++ b/addons/gut/gut.gd @@ -1,4 +1,5 @@ extends 'res://addons/gut/gut_to_move.gd' +class_name GutMain # ############################################################################## # @@ -916,7 +917,7 @@ func _get_files(path, prefix, suffix): # public # ######################### -func get_elapsed_time(): +func get_elapsed_time() -> float: var to_return = 0.0 if(_start_time != 0.0): to_return = Time.get_ticks_msec() - _start_time diff --git a/addons/gut/test.gd b/addons/gut/test.gd index 3eeae5ea..132e50ce 100644 --- a/addons/gut/test.gd +++ b/addons/gut/test.gd @@ -46,7 +46,7 @@ var _compare = _utils.Comparator.new() # Need a reference to the instance that is running the tests. This # is set by the gut class when it runs the tests. This gets you # access to the asserts in the tests you write. -var gut = null +var gut: GutMain = null var _disable_strict_datatype_checks = false # Holds all the text for a test's fail/pass. This is used for testing purposes