MCPcopy
hub / github.com/prometheus/client_golang / expectPanic

Function expectPanic

prometheus/counter_test.go:136–144  ·  view source on GitHub ↗
(t *testing.T, op func(), errorMsg string)

Source from the content-addressed store, hash-verified

134}
135
136func expectPanic(t *testing.T, op func(), errorMsg string) {
137 defer func() {
138 if err := recover(); err == nil {
139 t.Error(errorMsg)
140 }
141 }()
142
143 op()
144}
145
146func TestCounterAddInf(t *testing.T) {
147 now := time.Now()

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected