From cdd49246684d446c0115bc5cfbca289eaa5fe354 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 14 Apr 2024 20:32:23 +0200 Subject: [PATCH] awawawawawawawawawawawawawawawawawawwawa --- addons/besseretests/src/runtimescene.gd | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/addons/besseretests/src/runtimescene.gd b/addons/besseretests/src/runtimescene.gd index c4193e0..06ebb82 100644 --- a/addons/besseretests/src/runtimescene.gd +++ b/addons/besseretests/src/runtimescene.gd @@ -28,9 +28,6 @@ var stats_unknown: int = 0 # To stop any still running test var crashed: bool = false -# To decrease allocations == to increase performance -var temp_test_message: String = "" - # +++ initialization +++ # Startup function func _ready() -> void: @@ -255,15 +252,15 @@ func run_suite(suite: String) -> void: await suite_node.after_each() if crashed: return - temp_test_message = lsanitize(suite_node.test_message) if suite_node.test_message != "" else "[i]No message has been set.[/i]" + var test_message: String = lsanitize(suite_node.test_message) if suite_node.test_message != "" else "[i]No message has been set.[/i]" # Merge result into result dictionary - results.merge({ suite + ":" + test_method["name"].replace("test_", ""): { "status": suite_node.test_status, "message": temp_test_message } }) + results.merge({ suite + ":" + test_method["name"].replace("test_", ""): { "status": suite_node.test_status, "message": test_message } }) # Print result match(suite_node.test_status): - 0: lresu("[color=green]Test " + suite + ":" + test_method["name"].replace("test_", "") + " has passed: " + temp_test_message + "[/color]") - 1: lresu("[color=yellow]Test " + suite + ":" + test_method["name"].replace("test_", "") + " has passed with warnings: " + temp_test_message + "[/color]") - 2: lresu("[color=red]Test " + suite + ":" + test_method["name"].replace("test_", "") + " has failed: " + temp_test_message + "[/color]") - 3: lresu("[color=gray]Test " + suite + ":" + test_method["name"].replace("test_", "") + " was skipped: " + temp_test_message + "[/color]") + 0: lresu("[color=green]Test " + suite + ":" + test_method["name"].replace("test_", "") + " has passed: " + test_message + "[/color]") + 1: lresu("[color=yellow]Test " + suite + ":" + test_method["name"].replace("test_", "") + " has passed with warnings: " + test_message + "[/color]") + 2: lresu("[color=red]Test " + suite + ":" + test_method["name"].replace("test_", "") + " has failed: " + test_message + "[/color]") + 3: lresu("[color=gray]Test " + suite + ":" + test_method["name"].replace("test_", "") + " was skipped: " + test_message + "[/color]") 505: lresu("[color=red]Test " + suite + ":" + test_method["name"].replace("test_", "") + " returned an invalid status (did you forget to set the test status?).[/color]") _: lresu("[color=red]Test " + suite + ":" + test_method["name"].replace("test_", "") + " returned an invalid status.[/color]")