From 114ac39917bf03a0e7a07fe62d7373d936ff4b4e Mon Sep 17 00:00:00 2001 From: chrislu Date: Sun, 7 Jul 2024 23:43:38 -0700 Subject: [PATCH] add a simple test --- weed/util/queue_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 weed/util/queue_test.go diff --git a/weed/util/queue_test.go b/weed/util/queue_test.go new file mode 100644 index 000000000..a79552893 --- /dev/null +++ b/weed/util/queue_test.go @@ -0,0 +1,22 @@ +package util + +import ( + "github.com/stretchr/testify/assert" + "testing" +) + +func TestNewQueue(t *testing.T) { + + q := NewQueue[int]() + + for i := 0; i < 10; i++ { + q.Enqueue(i) + } + + assert.Equal(t, q.Len(), 10) + + for i := 0; i < 10; i++ { + assert.Equal(t, q.Dequeue(), i) + } + +}