mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-23 18:49:17 +08:00
add a simple test
This commit is contained in:
parent
f77eee667d
commit
114ac39917
22
weed/util/queue_test.go
Normal file
22
weed/util/queue_test.go
Normal file
@ -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)
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user