MCPcopy
hub / github.com/charmbracelet/log / TestPrefix

Function TestPrefix

pkg_test.go:204–215  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

202}
203
204func TestPrefix(t *testing.T) {
205 var buf bytes.Buffer
206 SetOutput(colorprofile.NewWriter(&buf, os.Environ()))
207 SetLevel(WarnLevel)
208 SetReportCaller(false)
209 SetReportTimestamp(false)
210 SetPrefix("prefix")
211 Warn("info")
212 assert.Equal(t, "WARN prefix: info\n", buf.String())
213 assert.Equal(t, "prefix", GetPrefix())
214 SetPrefix("")
215}
216
217func TestFormatter(t *testing.T) {
218 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 8

SetOutputFunction · 0.85
SetLevelFunction · 0.85
SetReportCallerFunction · 0.85
SetReportTimestampFunction · 0.85
SetPrefixFunction · 0.85
WarnFunction · 0.85
GetPrefixFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…