MCPcopy Index your code
hub / github.com/aceld/zinx / TestDelay

Function TestDelay

znet/acceptdelay_test.go:21–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19}
20
21func TestDelay(t *testing.T) {
22 assert.Equal(t, time.Duration(0), AcceptDelay.duration)
23 AcceptDelay.Up()
24 assert.Equal(t, 5*time.Millisecond, AcceptDelay.duration)
25 AcceptDelay.Reset()
26 assert.Equal(t, time.Duration(0), AcceptDelay.duration)
27
28 for i := 0; i < 600; i++ {
29 AcceptDelay.Up()
30 }
31 assert.Equal(t, 1*time.Second, AcceptDelay.duration)
32}
33
34func TestMain(m *testing.M) {
35 setup()

Callers

nothing calls this directly

Calls 2

UpMethod · 0.80
ResetMethod · 0.45

Tested by

no test coverage detected