Bold the startup banner on TTY; blank line after banner

This commit is contained in:
2026-06-17 05:52:03 +02:00
parent edd3e5fdb2
commit 75564a504e
3 changed files with 18 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ func TestMessageMethodsPlain(t *testing.T) {
{"Error", func(w *Writer) { w.Error("boom") }, "🛑 ERROR: boom\n"},
{"Progress", func(w *Writer) { w.Progress("p") }, " 》 p\n"},
{"Detail", func(w *Writer) { w.Detail("d") }, " 》 d\n"},
{"Banner", func(w *Writer) { w.Banner("hello") }, "hello\n"},
{"Banner", func(w *Writer) { w.Banner("hello") }, "hello\n"}, // plain mode, no bold
}
for _, tt := range tests {
@@ -69,6 +69,15 @@ func TestColorOutputContainsANSI(t *testing.T) {
}
}
func TestBannerBoldWhenColor(t *testing.T) {
w, buf := newTestWriter(true)
w.Banner("hello")
out := buf.String()
if !strings.Contains(out, "\033[1m") {
t.Errorf("expected bold ANSI escape in colored Banner output, got %q", out)
}
}
func TestValueFormattersPlain(t *testing.T) {
w, _ := newTestWriter(false)