MCPcopy
hub / github.com/moonD4rk/HackBrowserData / TestLoggerDebugf

Function TestLoggerDebugf

log/logger_test.go:150–165  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

148}
149
150func TestLoggerDebugf(t *testing.T) {
151 for _, tc := range formatTestCases {
152 tc := tc
153 tc.level = DebugLevel
154 message := fmt.Sprintf(tc.format, tc.args...)
155 tc.wantedPattern = fmt.Sprintf(`^\[DBG\] \w+\.go:\d+: %s\n$`, message)
156 t.Run(tc.description, func(t *testing.T) {
157 var buf bytes.Buffer
158 logger := NewLogger(newBase(&buf))
159 logger.SetLevel(DebugLevel)
160 logger.Debugf(tc.format, tc.args...)
161 got := buf.String()
162 assert.Regexp(t, tc.wantedPattern, got)
163 })
164 }
165}
166
167func TestLoggerInfof(t *testing.T) {
168 for _, tc := range formatTestCases {

Callers

nothing calls this directly

Calls 5

SetLevelMethod · 0.95
DebugfMethod · 0.95
NewLoggerFunction · 0.85
newBaseFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected