Bold the startup banner on TTY; blank line after banner
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user