From e90ab5efa99a217a2893f4d69e2529c72e4bb05a Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sat, 6 Apr 2024 13:54:09 +0200 Subject: [PATCH] Improve results grammar --- addons/besseretests/src/runtimescene.gd | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/addons/besseretests/src/runtimescene.gd b/addons/besseretests/src/runtimescene.gd index 9aff373..63f6289 100644 --- a/addons/besseretests/src/runtimescene.gd +++ b/addons/besseretests/src/runtimescene.gd @@ -88,12 +88,19 @@ func _ready() -> void: if stats_all == 0: lresu(" -> [color=white]No tests were executed[/color]") elif stats_all == stats_ok: lresu(" -> [color=green]All " + str(stats_all) + " tests have passed") else: - lresu(" -> [color=green]" + str(stats_ok) + " tests have passed[/color]") - lresu(" -> [color=yellow]" + str(stats_warn) + " tests have passed with warnings[/color]") - lresu(" -> [color=red]" + str(stats_error) + " tests failed[/color]") + if stats_ok == 1: lresu(" -> [color=green]" + str(stats_ok) + " test has passed[/color]") + else: lresu(" -> [color=green]" + str(stats_ok) + " tests have passed[/color]") + if stats_warn == 1: lresu(" -> [color=yellow]" + str(stats_warn) + " test has passed with warnings[/color]") + else: lresu(" -> [color=yellow]" + str(stats_warn) + " tests have passed with warnings[/color]") + if stats_error == 1: lresu(" -> [color=red]" + str(stats_error) + " test has failed[/color]") + else: lresu(" -> [color=red]" + str(stats_error) + " tests have failed[/color]") lresu(" -> [color=gray]" + str(stats_skip) + " tests were skipped[/color]") - if stats_forgot != 0: lerror(" -> " + str(stats_forgot) + " tests did not set their status (fix that!)") - if stats_unknown != 0: lerror(" -> " + str(stats_unknown) + " tests have an unknown status (fix that!)") + if stats_forgot != 0: + if stats_forgot == 1: lerror(" -> " + str(stats_forgot) + " test did not update 'test_status' (fix that!)") + else: lerror(" -> " + str(stats_forgot) + " tests did not update 'test_status' (fix that!)") + if stats_unknown != 0: + if stats_unknown == 1: lerror(" -> " + str(stats_unknown) + " test has an unknown status (fix that!)") + else: lerror(" -> " + str(stats_unknown) + " tests have an unknown status (fix that!)") lresu("") # Shutdown