diff --git a/tests/unit/core.gd b/tests/unit/core.gd index 3e22616..8761e4b 100644 --- a/tests/unit/core.gd +++ b/tests/unit/core.gd @@ -21,6 +21,7 @@ func test_initialization() -> void: if !utils.is_framework_loaded(): test_status = 2 test_message = "utils.is_framework_loaded() returned 'false'" + return test_status = 0 test_message = "Framework did initialize correctly" @@ -44,23 +45,28 @@ func test_custom_module_support() -> void: if callback != "_initialize" and callback != "_pull_config": test_status = 2 test_message = "Module did not register" + return elif core.get_node_or_null("Custom Modules/test_module") == null: test_status = 2 test_message = "Could not find module node" + return # Get module var module_get: CoreBaseModule = core.get_custom_module("test_module") if module_get == null: test_status = 2 test_message = "Got null from get_custom_module method" + return if module_get != module: test_status = 2 test_message = "Got invalid node from get_custom_module method" + return # Get string if module.hello_test() != "Hello Test!": test_status = 2 test_message = "Module did not return test string" + return # Unregister module core.unregister_custom_module("test_module") @@ -70,6 +76,7 @@ func test_custom_module_support() -> void: if core.get_node_or_null("Custom Modules/test_module") == null: test_status = 0 test_message = "Successfully registered, got, used and unregistered a custom module" + return func test_reload_config() -> void: # Variables @@ -90,11 +97,13 @@ func test_reload_config() -> void: if core.config != config: test_status = 2 test_message = "Got invalid node from config variable" + return # Check config in modules if core.logger.config_colored != false or core.logger.config_level != CoreTypes.LoggerLevel.NONE or core.logui.background.visible != false: test_status = 2 test_message = "Configuration did not apply all values correctly" + return test_status = 0 test_message = "Framework applied all modified keys correctly"