-
Notifications
You must be signed in to change notification settings - Fork 664
/
colors.go
30 lines (26 loc) · 967 Bytes
/
colors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package tests
import (
"github.com/onsi/ginkgo/v2/formatter"
ginkgo "github.com/onsi/ginkgo/v2"
)
// Outputs to stdout.
//
// Examples:
//
// - Out("{{green}}{{bold}}hi there %q{{/}}", "aa")
// - Out("{{magenta}}{{bold}}hi therea{{/}} {{cyan}}{{underline}}b{{/}}")
//
// See https://github.com/onsi/ginkgo/blob/v2.0.0/formatter/formatter.go#L52-L73
// for an exhaustive list of color options.
func Outf(format string, args ...interface{}) {
s := formatter.F(format, args...)
// Use GinkgoWriter to ensure that output from this function is
// printed sequentially within other test output produced with
// GinkgoWriter (e.g. `STEP:...`) when tests are run in
// parallel. ginkgo collects and writes stdout separately from
// GinkgoWriter during parallel execution and the resulting output
// can be confusing.
ginkgo.GinkgoWriter.Print(s)
}