fix(diary): skip HideOnTTY records only on a terminal console, also with forced color (IN-01, quick-261028-rqd)
This commit is contained in:
@@ -357,8 +357,10 @@ func TestHideOnTTY(t *testing.T) {
|
||||
blog := diary.For("blog")
|
||||
blog.InfoContext(ctx, "hidden summary")
|
||||
blog.Info("shown line")
|
||||
if strings.Contains(styled.String(), "hidden summary") {
|
||||
t.Errorf("styled console shows a HideOnTTY record:\n%s", styled.String())
|
||||
// IN-01: forced color on a writer that is not a terminal keeps the
|
||||
// HideOnTTY records; only a terminal console skips them.
|
||||
if !strings.Contains(styled.String(), "hidden summary") {
|
||||
t.Errorf("styled console off a terminal dropped a HideOnTTY record:\n%s", styled.String())
|
||||
}
|
||||
if !strings.Contains(styled.String(), "shown line") {
|
||||
t.Errorf("styled console lacks the ordinary record:\n%s", styled.String())
|
||||
|
||||
Reference in New Issue
Block a user