Improve the code coverage of the gpool, gqueue, gring module (#1987)

This commit is contained in:
黄骞
2022-07-11 19:34:40 +08:00
committed by GitHub
parent 4c1cf73005
commit e38c455252
3 changed files with 72 additions and 0 deletions

View File

@ -62,4 +62,12 @@ func TestQueue_Close(t *testing.T) {
t.Assert(q1.Len(), 2)
q1.Close()
})
gtest.C(t, func(t *gtest.T) {
q1 := gqueue.New(2)
q1.Push(1)
q1.Push(2)
time.Sleep(time.Millisecond)
t.Assert(q1.Len(), 2)
q1.Close()
})
}