MCPcopy Index your code
hub / github.com/coder/coder / testHandler

Function testHandler

cli/clilog/clilog_test.go:159–174  ·  view source on GitHub ↗
(t testing.TB, opts ...clilog.Option)

Source from the content-addressed store, hash-verified

157)
158
159func testHandler(t testing.TB, opts ...clilog.Option) serpent.HandlerFunc {
160 t.Helper()
161
162 return func(inv *serpent.Invocation) error {
163 logger, closeLog, err := clilog.New(opts...).Build(inv)
164 if err != nil {
165 return err
166 }
167 defer closeLog()
168 logger.Debug(inv.Context(), debugLog)
169 logger.Info(inv.Context(), infoLog)
170 logger.Warn(inv.Context(), warnLog)
171 logger.Debug(inv.Context(), filterLog)
172 return nil
173 }
174}
175
176func assertLogs(t testing.TB, path string, expected ...string) {
177 t.Helper()

Callers 1

TestBuilderFunction · 0.85

Calls 5

NewFunction · 0.92
HelperMethod · 0.65
BuildMethod · 0.65
ContextMethod · 0.65
InfoMethod · 0.45

Tested by

no test coverage detected