From 40f7b85bca987596042c789732a1ded67496f257 Mon Sep 17 00:00:00 2001 From: luaneko Date: Fri, 27 Jun 2025 14:39:04 +1000 Subject: [PATCH] Pretty icons --- tests/test.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/test.lua b/tests/test.lua index 4ac51bd..c6ae3db 100644 --- a/tests/test.lua +++ b/tests/test.lua @@ -12,6 +12,12 @@ local colors = { fail = "\x1b[31;1m", } +local icons = { + check = "\u{2713}", + cross = "\u{00d7}", + chevron = "\u{203a}", +} + local function color(name, s) return colors[name] .. s .. colors.reset end @@ -48,7 +54,7 @@ local function name_test(test) local name = test.name local group = test.group while group ~= nil do - if group.name ~= "" then name = group.name .. " › " .. name end + if group.name ~= "" then name = string.format("%s %s %s", group.name, icons.chevron, name) end group = group.parent end return name @@ -93,14 +99,14 @@ local function main(item) end end if fail == 0 then - print("", color("pass", string.format("%d tests passed", pass))) + print("", color("pass", string.format("%s %d tests passed", icons.check, pass))) return 0 end print( "", - color("pass", string.format("%d tests passed", pass)) + color("pass", string.format("%s %d tests passed", icons.check, pass)) .. ", " - .. color("fail", string.format("%d tests failed", fail)) + .. color("fail", string.format("%s %d tests failed", icons.cross, fail)) ) return 1 -- report error to cargo end