From 9607c34ecf36e64d239e39ba8aafbcbb4484ec27 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 31 Mar 2024 11:23:36 +0200 Subject: [PATCH] Update unitbase.gd --- tests/unit/core.gd | 6 +++--- tests/unit/misc.gd | 16 ++++++++-------- tests/unitbase.gd | 8 +++++--- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/tests/unit/core.gd b/tests/unit/core.gd index cde9193..d65568c 100644 --- a/tests/unit/core.gd +++ b/tests/unit/core.gd @@ -17,7 +17,7 @@ func test_custom_module_support() -> void: # Init CORE var config: CoreConfiguration = CoreConfiguration.new() config.custom_modules = true - var core_test: Core = await load_framework(config) + core_test = await load_framework(config) # Load module var module: CoreBaseModule = CoreBaseModule.new() @@ -63,7 +63,7 @@ func test_reload_config() -> void: var config: CoreConfiguration = CoreConfiguration.new() # Init CORE - var core_test: Core = await load_framework() + core_test = await load_framework() # Update some keys and reload config.logger_colored = false @@ -87,7 +87,7 @@ func test_reload_config() -> void: func test_formatted_string() -> void: # Init CORE - var core_test: Core = await load_framework() + core_test = await load_framework() # Variables var test_type: String diff --git a/tests/unit/misc.gd b/tests/unit/misc.gd index 612d49a..7073d2f 100644 --- a/tests/unit/misc.gd +++ b/tests/unit/misc.gd @@ -3,7 +3,7 @@ extends 'res://tests/unitbase.gd' # byte2mib func test_byte2mib() -> void: # Init CORE - var core_test: Core = await load_framework() + core_test = await load_framework() # Variables var test_in: int = 51758516 @@ -23,7 +23,7 @@ func test_byte2mib() -> void: # mib2byte func test_mib2byte() -> void: # Init CORE - var core_test: Core = await load_framework() + core_test = await load_framework() # Variables var test_in: float = 49.36076736450195 @@ -43,7 +43,7 @@ func test_mib2byte() -> void: # mib2gib func test_mib2gib() -> void: # Init CORE - var core_test: Core = await load_framework() + core_test = await load_framework() # Variables var test_in: float = 1500 @@ -63,7 +63,7 @@ func test_mib2gib() -> void: # gib2mib func test_gib2mib() -> void: # Init CORE - var core_test: Core = await load_framework() + core_test = await load_framework() # Variables var test_in: float = 1.46484375 @@ -83,7 +83,7 @@ func test_gib2mib() -> void: # format_stringarray func test_format_stringarray() -> void: # Init CORE - var core_test: Core = await load_framework() + core_test = await load_framework() # Variables var test_in: Array[String] = ["StarOpenSource", "JeremyStarTM", "Contributors"] @@ -98,7 +98,7 @@ func test_format_stringarray() -> void: # format_stringarray (chaotic) func test_format_stringarray_chaotic() -> void: # Init CORE - var core_test: Core = await load_framework() + core_test = await load_framework() # Variables var test_in: Array[String] = ["StarOpenSource", "JeremyStarTM", "Contributors"] @@ -113,7 +113,7 @@ func test_format_stringarray_chaotic() -> void: # array_to_stringarray & stringarray_to_array func test_array_stringarray_conversion() -> void: # Init CORE - var core_test: Core = await load_framework() + core_test = await load_framework() # Variables var test_in: Array = ["StarOpenSource", "JeremyStarTM", "Contributors"] @@ -128,7 +128,7 @@ func test_array_stringarray_conversion() -> void: # get_center func test_get_center() -> void: # Init CORE - var core_test = await load_framework() + core_test = await load_framework() # Variables var test_in_parent: Vector2 = Vector2(5919.591, 6815.9514) diff --git a/tests/unitbase.gd b/tests/unitbase.gd index 176e69a..931c5c3 100644 --- a/tests/unitbase.gd +++ b/tests/unitbase.gd @@ -1,14 +1,16 @@ extends BessereTestsTest -# Callbacks -var callback: String = "" - # CORE var core: Core +# Used during testing +var callback: String = "" +var core_test: Core + # Unload framework after each test func after_each() -> void: callback = "" + core_test = null await unload_framework() # Framework management