From 91b866c9675256d7bb42b7a04865b34003f53b29 Mon Sep 17 00:00:00 2001 From: Zack Puhl Date: Sat, 2 Aug 2025 17:17:34 -0400 Subject: [PATCH] Immediately skip empty tests (#2352) --- lib/std/core/runtime_test.c3 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/std/core/runtime_test.c3 b/lib/std/core/runtime_test.c3 index a0adce33e..8848dced9 100644 --- a/lib/std/core/runtime_test.c3 +++ b/lib/std/core/runtime_test.c3 @@ -171,6 +171,11 @@ fn bool run_tests(String[] args, TestUnit[] tests) @private usz max_name; bool sort_tests = true; bool check_leaks = true; + if (!tests.len) + { + io::printn("There are no test units to run."); + return true; // no tests == technically a pass + } foreach (&unit : tests) { if (max_name < unit.name.len) max_name = unit.name.len; @@ -305,7 +310,7 @@ fn bool run_tests(String[] args, TestUnit[] tests) @private } mem.free(); } - io::printfn("\n%d test%s run.\n", test_count-tests_skipped, test_count > 1 ? "s" : ""); + io::printfn("\n%d test%s run.\n", test_count-tests_skipped, test_count != 1 ? "s" : ""); int n_failed = test_count - tests_passed - tests_skipped; io::printf("Test Result: %s%s%s: ",