MCPcopy Index your code
hub / github.com/DoNewsCode/core / TestContainer_Shutdown

Function TestContainer_Shutdown

c_test.go:210–218  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

208}
209
210func TestContainer_Shutdown(t *testing.T) {
211 seq := 0
212 container := New()
213 container.AddModule(closer(func() { assert.Equal(t, 2, seq); seq = 1 }))
214 container.AddModule(closer(func() { assert.Equal(t, 3, seq); seq = 2 }))
215 container.AddModule(closer(func() { assert.Equal(t, 0, seq); seq = 3 }))
216 container.Shutdown()
217 assert.Equal(t, 1, seq)
218}
219
220func TestC_AddModule(t *testing.T) {
221 type Module struct {

Callers

nothing calls this directly

Calls 4

closerFuncType · 0.85
ShutdownMethod · 0.80
NewFunction · 0.70
AddModuleMethod · 0.45

Tested by

no test coverage detected