chore: simplify workflows and unify tool logging and mail presentation
Release / Validate Templates (push) Successful in 2m55s
Release / Package & Release (push) Skipped
Release / Remind to Update Release Documentation (push) Skipped

This commit is contained in:
KenanZhu committed 2026-10-10 14:54:40 +08:00
1 parent f4d96de79e
commit c93f2bf8b2
40 files changed
+523 -1515

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
package logging
import (
"bytes"
"testing"
)
func TestFormat(t *testing.T) {
for _, tc := range []struct {
level, code string
}{{"I", "32"}, {"W", "33"}, {"E", "31"}, {"F", "35"}} {
t.Run(tc.level, func(t *testing.T) {
for _, color := range []bool{false, true} {
var buf bytes.Buffer
write(&buf, color, tc.level, "Builder", "first\r\nsecond\n")
label := "[" + tc.level + "]"
if color {
label = "\033[" + tc.code + "m" + label + "\033[0m"
}
want := label + " [Builder] first\n" + label + " [Builder] second\n"
if buf.String() != want {
t.Fatalf("got %q, want %q", buf.String(), want)
}
}
})
}
}