From 78b0cae892fd1e38286f832045457a02a1d0d94b Mon Sep 17 00:00:00 2001 From: jroam Date: Sun, 16 Jun 2019 22:05:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=88=E5=8F=96=E6=B6=88=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g/container/gqueue/gqueue_unit_test.go | 60 -------------------------- 1 file changed, 60 deletions(-) delete mode 100644 g/container/gqueue/gqueue_unit_test.go diff --git a/g/container/gqueue/gqueue_unit_test.go b/g/container/gqueue/gqueue_unit_test.go deleted file mode 100644 index a99fda022..000000000 --- a/g/container/gqueue/gqueue_unit_test.go +++ /dev/null @@ -1,60 +0,0 @@ -package gqueue_test - -import ( - "github.com/gogf/gf/g/container/gqueue" - "github.com/gogf/gf/g/test/gtest" - "testing" -) - -func TestQueue_Len(t *testing.T) { - q1 := gqueue.New(300) - for i := 0; i < 200; i++ { - q1.Push(i) - } - gtest.Assert(q1.Len(), 200) -} - -func TestQueue_Pop(t *testing.T) { - q1 := gqueue.New() - - q1.Push(1) - q1.Push(2) - i1 := q1.Pop() - gtest.Assert(i1, 1) - q1.Close() - i1 = q1.Pop() - gtest.Assert(i1, 2) - - maxs := 12 - q2 := gqueue.New(maxs) - for i := 0; i < maxs; i++ { - q2.Push(i) - } - - i3 := q2.Pop() - gtest.Assert(i3, 0) - -} - -func TestQueue_Pop2(t *testing.T) { - - maxs := 14 - q2 := gqueue.New(maxs) - for i := 1; i < maxs; i++ { - q2.Push(i) - } - i3 := q2.Pop() - gtest.Assert(i3, 1) - -} - -func TestQueue_Close(t *testing.T) { - q1 := gqueue.New() - q1.Push(1) - q1.Push(2) - gtest.Assert(q1.Len(), 2) - - q1.Close() - gtest.Assert(q1.Len(), 2) - -}