MCPcopy
hub / github.com/uber-go/zap / assertGoexit

Function assertGoexit

zapcore/entry_test.go:32–46  ·  view source on GitHub ↗
(t *testing.T, f func())

Source from the content-addressed store, hash-verified

30)
31
32func assertGoexit(t *testing.T, f func()) {
33 var finished bool
34 recovered := make(chan interface{})
35 go func() {
36 defer func() {
37 recovered <- recover()
38 }()
39
40 f()
41 finished = true
42 }()
43
44 assert.Nil(t, <-recovered, "Goexit should cause recover to return nil")
45 assert.False(t, finished, "Goroutine should not finish after Goexit")
46}
47
48func TestPutNilEntry(t *testing.T) {
49 // Pooling nil entries defeats the purpose.

Callers 1

TestCheckedEntryWriteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected